Cron example
Cron Every 2 Hours
A step in the hour field: minute zero of every second hour, starting at midnight. That gives twelve runs a day at 00:00, 02:00, 04:00 and so on through 22:00 — all even hours, because the step counts from the bottom of the range rather than from the moment you installed the line.
By NaveenKumar T · Updated · 5-field crontab expression
What each field means
| Field | Value | Meaning |
|---|---|---|
| Minute | 0 | Minute 0 |
| Hour | */2 | Every 2 hours, starting at hour 0 |
| 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…
Even hours, and how to get odd ones
Cron expands the stepped hour field to 0,2,4,6,8,10,12,14,16,18,20,22. There is no way to shift that with the step syntax alone, so a job that needs odd hours must either use a list — 0 1,3,5,7,9,11,13,15,17,19,21,23 * * * — or the range-with-step form 1-23/2, which starts the sampling at 1 instead of 0 and produces exactly the same twelve odd hours.
That distinction is worth remembering because it generalises. Any time you want a stepped schedule that does not begin at the field's minimum, write the range explicitly: 1-23/2 for odd hours, 30-59/10 for the second half of an hour, 2-59/5 to offset a five-minute poll away from the top of the hour.
What a two-hour cadence is for
Twelve runs a day suits work that is too heavy to run hourly and too time-sensitive to leave until tomorrow: incremental backups, warehouse loads, sitemap regeneration, cache warming after a bulk import, or a report that only needs to be a couple of hours fresh. It also gives a slow job an unusually generous window — anything under two hours finishes cleanly without overlapping.
Because 24 divides by 2, the schedule is symmetric across the day: the same twelve wall-clock times every day, easy to reason about in a runbook. Steps of 3, 4, 6, 8 and 12 share that property; a step of 5 or 7 does not, and produces a short final gap when the day rolls over at midnight.
Daylight saving and going coarser
On a host with DST, the spring-forward day loses one of the twelve slots and the autumn day may repeat one, exactly as it does for hourly jobs. If the run count matters, schedule in UTC. If only rough freshness matters, ignore it — one missing run in a year is not worth a workaround.
To halve the frequency again, every 6 hours is the natural next stop at four runs a day, and a step of 12 or the equivalent twice a day form takes it down to two.
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.