Cron n/step: starting a step from a value you choose
Writing a number before the slash starts the step at that value instead of at the field minimum. 5/15 in the minute field matches 5, 20, 35 and 50.
At a glance
- Meaning
- Start at the given value and step upwards to the end of the field.
- Example
- 5/15 in the minute field gives 5, 20, 35, 50.
- Upper bound
- The field maximum, not the end of any range. 5/15 stops at 50 because 65 is out of range.
- Equivalent range form
- 5-59/15 produces the same values and is accepted too.
- With names
- Allowed where the field supports names, so JAN/3 works in the month field.
- Main use
- Offsetting a schedule so it does not collide with everything else on the hour.
In detail
The start at step form replaces the asterisk in front of the slash with a starting value. The parser resolves that value, then walks upwards by the step until it passes the field maximum. So 5/15 in the minute field starts at 5 and matches 5, 20, 35 and 50, four values, exactly as many as */15 but shifted by five minutes.
This is the tool for spreading load. Minute 0 of every hour carries the hourly jobs, the quarter hourly jobs and everything else aligned to the top of the hour, so a busy machine has a visible spike there. Moving a job from */15 to 7/15 keeps the frequency identical and puts every run on a minute nothing else uses.
The walk always runs to the top of the field, which is what distinguishes it from a range with a step. 5/15 and 5-59/15 give the same result because 59 is the field maximum anyway, but 5-30/15 gives only 5 and 20. Use the range form when you want to stop early, and the start at step form when you want to shift the phase.
It works in every field, and it is the only way to offset a stepped month or hour schedule. 2/3 in the month field gives February, May, August and November, which is a fiscal quarter cycle. 6/12 in the hour field gives 06:00 and 18:00 rather than midnight and midday. In both cases a plain step cannot express it.
Examples
7/15 * * * *Minutes 7, 22, 37 and 52. Four runs an hour, none on a quarter hour.
0 0 1 2/3 *February, May, August and November.
0 6/12 * * *06:00 and 18:00.
Things that catch people out
- The value before the slash is a starting point, not a count. 5/15 does not mean five runs.
- The walk goes to the top of the field and ignores where you might want it to stop. Use a range with a step for that.
- A start value outside the field range is rejected, so 61/5 in the minute field is an error rather than a silent no match.
Try it: Cron Expression Parser
Paste any five or six field expression to get a plain English description, a per field breakdown and the next run times in your local time.
Cron Expression Parser
LOCAL · Browser-OnlyParse cron expressions and see the next scheduled run times
Supports 5-field (minute hour day month weekday), 6-field (with seconds), named values (JAN, MON), and @macros (@daily, @hourly, ...)
Use the dropdowns below to build your cron expression visually, or type a custom value in each field.
Human-Readable Description
Every 5 minutes
Field Breakdown
| Field | Allowed | Value | Meaning |
|---|---|---|---|
| Minute | 0-59 | */5 | every 5 minute(s) |
| Hour | 0-23 | * | every hour |
| Day of Month | 1-31 | * | every day of month |
| Month | 1-12 | * | every month |
| Day of Week | 0-7 | * | every day of week |
Related cron expressions
All cron expressions →Cron step values: what */n really does
*/n walks a field from its minimum in increments of n. Because it starts at the field minimum, */2 gives even minutes and odd days of the month.
The cron hyphen: inclusive ranges and why they cannot wrap
A hyphen range includes both ends, so 9-17 is nine values. The start must not be greater than the end, which is why 22-6 is rejected.
Cron every 5 minutes: */5 * * * *
*/5 * * * * fires 288 times a day at minutes 0, 5, 10 and so on. Why every job on the box lands on the same minute and how 2-59/5 fixes it.
Cron every quarter: 0 0 1 */3 *
0 0 1 */3 * runs on the 1st of January, April, July and October, four times a year. Shift it with 2/3 for a fiscal year starting in February.
The cron minute field: position, range and behaviour
The minute field runs 0 to 59 and is the first field in a five field expression, or the second when a seconds field is present.
The cron hour field: 0 to 23 on a 24 hour clock
The hour field runs 0 to 23 on a 24 hour clock. Midnight is 0, noon is 12, and 24 is out of range. There is no AM or PM notation.
Tools for this
- Cron Expression Parser Free online cron expression parser - parse cron expressions and see the next scheduled run times
- Crontab Generator Free online crontab generator - build cron expressions visually with an intuitive interface