Cron expression: every 4 hours
0 */4 * * *
Runs 6 times a day, at 00:00, 04:00, 08:00, 12:00, 16:00, 20:00.
What each field means
| Field | Value | Meaning |
|---|---|---|
| minute | 0 | minute 0 |
| hour | */4 | every 4 hours |
| day of month | * | every day of month |
| month | * | every month |
| day of week | * | every day of week |
Next runs
Starting from 1 January 2026, 00:00 UTC:
- Thursday 1 Jan 00:00
- Thursday 1 Jan 04:00
- Thursday 1 Jan 08:00
- Thursday 1 Jan 12:00
- Thursday 1 Jan 16:00
- Thursday 1 Jan 20:00
Things to watch
The step restarts at midnight each day, so the interval is even as long as 4 divides into 24 — which it does here.
The same schedule elsewhere
# crontab
0 */4 * * * /usr/local/bin/my-job >> /var/log/my-job.log 2>&1
# GitHub Actions (.github/workflows/job.yml) — always UTC
on:
schedule:
- cron: '0 */4 * * *'
# Kubernetes CronJob
spec:
schedule: "0 */4 * * *"
# AWS EventBridge — six fields, and ? in one of the day fields
cron(0 */4 * * ? *)
Frequently asked questions
What is the cron expression to run a job every 4 hours?
0 */4 * * * — Runs 6 times a day, at 00:00, 04:00, 08:00, 12:00, 16:00, 20:00.
Which time zone does cron use?
The server's local time zone, unless the scheduler says otherwise. GitHub Actions always uses UTC. Kubernetes CronJobs use UTC unless you set spec.timeZone. Running servers in UTC and converting only for display avoids an entire class of daylight-saving bugs.
What happens if the previous run is still going?
Standard cron starts a new one regardless, so long-running jobs can pile up. Wrap the command in flock -n /var/lock/my-job.lock, or set concurrencyPolicy: Forbid on a Kubernetes CronJob.
Why did my cron job not run at all?
The three usual causes: the script is not executable, the command relies on a PATH or environment variable that cron does not set, or output went nowhere because no mail transport is configured. Redirect stdout and stderr to a log file and the reason usually becomes obvious.