The expression
0 * * * *
Runs at minute 0 of every hour: 00:00, 01:00, 02:00 … 23:00, every day. That's 24 times a day.
| Field | Value | Meaning |
|---|---|---|
| Minute | 0 |
at minute 0 |
| Hour | * |
every hour |
| Day of month | * |
every day |
| Month | * |
every month |
| Day of week | * |
every day of the week |
The macro @hourly means exactly the same thing in Vixie cron, cronie and most libraries. The 0 in the minute field is what matters: it picks one minute per hour.
Variants
| Schedule | Expression |
|---|---|
| Every hour at half past | 30 * * * * |
| Every hour at a quiet minute | 17 * * * * |
| Every hour, 9 to 5 on weekdays | 0 9-17 * * 1-5 |
| Every hour, weekdays only | 0 * * * 1-5 |
| Every 30 minutes | */30 * * * * |
| Every 2 hours | 0 */2 * * * |
| Every 6 hours | 0 */6 * * * |
Where to write it
- crontab (Linux, macOS):
0 * * * * /usr/local/bin/rotate.shor@hourly /usr/local/bin/rotate.shincrontab -e. Many distributions also run scripts dropped into/etc/cron.hourly/, though not necessarily at minute 0 (Debian's/etc/crontabuses minute 17). - GitHub Actions:
on: schedule: - cron: '0 * * * *'. UTC. The top of the hour is the busiest time on GitHub's schedulers, and their docs warn that runs can be delayed or dropped then, so a minute like23 * * * *is more reliable. - Kubernetes CronJob:
schedule: "0 * * * *"or"@hourly";timeZone:only matters if you narrow the hours. - AWS EventBridge:
cron(0 * * * ? *).rate(1 hour)also runs hourly, but counted from when the rule was created, so it may fire at :37 instead of :00.
Common mistakes
* * * * *with a comment saying "hourly". Without a fixed minute, the job runs every minute.* */1 * * *runs every minute too.*/1in the hour field is just*; the minute field still says "every minute".- Daylight saving. In zones with DST, the change days have 23 or 25 hours, so an hourly job runs 23 or 25 times. If you count on exactly 24 runs (hourly buckets, billing), schedule it in UTC.
- Overlap. A run that sometimes takes over an hour needs
flock -nor a concurrency setting.
Paste any expression into the Cron Expression Parser to see it in words and its next run times.