Cron example
Cron Every Hour
Hourly is the most common non-daily schedule in production, and this is how you write it: at minute zero of every hour, twenty-four times a day. The single most frequent mistake here is putting an asterisk in the minute field, which quietly turns an hourly job into a once-a-minute job.
By NaveenKumar T · Updated · 5-field crontab expression
What each field means
| Field | Value | Meaning |
|---|---|---|
| Minute | 0 | Minute 0 |
| Hour | * | Every hour |
| Day of month | * | Every day |
| Month | * | Every month |
| Day of week | * | Every day of the week |
Next 5 run times
Computing the next runs in your timezone…
Why the minute field must be pinned
Cron evaluates every field against the current time and runs the command when all of them match. Leave the minute as an asterisk and every one of the sixty minutes in the hour matches, which is why five asterisks means every minute rather than every hour. The hour field being a wildcard is what makes the job hourly; the pinned minute is what makes it run once.
The same logic explains a whole family of mistakes. 0 0 * * * is not hourly, it is daily at midnight, because the hour is pinned too. Read a crontab line right to left — weekday, month, day, hour, minute — and the shape of the schedule falls out immediately.
Daylight saving and the missing hour
If the host's timezone observes daylight saving, one day a year has 23 hours and another has 25. On the spring-forward day an hourly job simply runs 23 times, because the 2 AM hour never exists on the wall clock. On the autumn day, most Linux crons run the repeated hour twice, so a job that writes an hourly report emits two reports stamped with the same local hour.
For anything where the count matters — billing rollups, sequence numbers, hourly partitions — run the daemon in UTC, or set CRON_TZ=UTC on the crontab line where your cron supports it. UTC has no transitions, so an hourly job runs 24 times a day, all year, without a special case.
Narrower hourly schedules
The hour field is where hourly schedules get interesting. A step thins it out to every 2 hours or every 6 hours; a range confines it to work hours; a list such as 0 6,12,18 * * * picks specific times of day.
Move the minute off zero whenever you can. The top of the hour is the busiest moment on most systems, so 17 * * * * gives your job an uncontended machine while remaining, in every meaningful sense, hourly.
Build a variant of this schedule with dropdowns and check the next ten runs before you install it.
Open the cron generatorRelated cron examples
Browse every schedule on the cron expression generator, read the cron expression syntax guide for the rules behind the five fields, or the developer tools guides for the longer explanations.