Why */7 in cron is not an even seven-minute interval
You scheduled a job with */7 in the minute field expecting it every seven minutes, and the gaps are uneven.
A step applies within each hour and restarts at the top of it. */7 fires at minutes 0, 7, 14, 21, 28, 35, 42, 49 and 56, and then the next fire is minute 0 of the following hour — four minutes later, not seven. A step gives even spacing only when it divides sixty exactly.
What a step actually means
The step operator generates values from the start of the field's range, and the range resets every hour for minutes and every day for hours. It is not an interval timer; it is a filter over allowed values. Nothing carries across the boundary.
Which steps are safe
For minutes, the divisors of sixty: 1, 2, 3, 4, 5, 6, 10, 12, 15, 20 and 30. For hours, the divisors of twenty-four: 1, 2, 3, 4, 6, 8 and 12. Anything else leaves a short gap at the boundary, and the more awkward the step, the larger the anomaly.
Getting a genuine interval
If the spacing must be exact, cron is the wrong tool: use a scheduler that computes the next run from the previous completion, or have the job schedule its own successor. Cron answers "at which wall-clock times", not "how long since last time".
The other field that surprises people
Day-of-month and day-of-week are combined with OR rather than AND whenever both are restricted. A schedule reading 1-7 in the day field and MON in the weekday field runs on every day from the first to the seventh AND on every Monday, which is not first-Monday and is not what most people intend. Expressing first-Monday needs the day range plus a weekday check inside the job itself.
Minute steps and their boundary gap
Minute steps and their boundary gap
| Step | Fires at | Gap at the hour |
| */5 | 0,5,...,55 | 5 min — even |
| */10 | 0,10,...,50 | 10 min — even |
| */15 | 0,15,30,45 | 15 min — even |
| */7 | 0,7,...,56 | 4 min — uneven |
| */25 | 0,25,50 | 10 min — uneven |
| */45 | 0,45 | 15 min — uneven |
Key facts
- A cron step restarts at the beginning of its field's range every hour, so */7 leaves a four-minute gap between minute 56 and minute 0.
- Minute steps give even spacing only for divisors of sixty: 1, 2, 3, 4, 5, 6, 10, 12, 15, 20 and 30.
- Hour steps give even spacing only for divisors of twenty-four: 1, 2, 3, 4, 6, 8 and 12.
- Cron expresses wall-clock times rather than intervals, so exact spacing requires a scheduler that measures from the previous completion.
- When day-of-month and day-of-week are both restricted, cron runs the job if either matches, which surprises people expecting both.
Frequently asked questions
Does the uneven gap matter?
Rarely for cleanup work, and considerably for anything measuring rates or holding a lock for the expected duration. A job assuming seven minutes of separation will overlap itself once an hour.
How do I run something every seven minutes exactly?
Schedule it every minute and have the job check whether seven minutes have elapsed since its last recorded run, or use a scheduler that supports true intervals. Cron cannot express it.
Why does my first-Monday schedule fire on extra days?
Because restricting both day fields ORs them rather than intersecting them. Leave one field as a wildcard and do the second check in the job, which is the only way to express the intersection in standard cron.
Machine-readable copy of this page:
/guide/why-a-cron-step-is-not-an-even-interval.md