Cron in five fields: minute, hour, day, month, weekday
One-line answer: What each of the five Unix cron fields means, which values are allowed, and how to read an expression without guessing.
A cron expression is five fields separated by spaces, in the order minute hour day month weekday. Each field describes the set of values allowed in that position. Every minute the scheduler checks whether the current time satisfies all five fields and runs the job if it does.
| Field | Meaning | Allowed values | Example |
|---|---|---|---|
| 1 | Minute | 0–59 | 30 — at half past every hour |
| 2 | Hour | 0–23 (24-hour clock) | 9 — at 09:00 |
| 3 | Day of month | 1–31 | 1 — on the first of the month |
| 4 | Month | 1–12 or JAN–DEC | 1,7 — January and July |
| 5 | Day of week | 0–7 (0 and 7 are Sunday) or SUN–SAT | 1-5 — Monday to Friday |
The most common mistake is the weekday origin. In Unix cron 0 is Sunday and 1 is Monday. Many implementations also accept 7 as Sunday, but people regularly write 6 thinking it means Sunday. Using names such as MON removes the ambiguity.
Five patterns worth memorising
* * * * * every minute
*/5 * * * * every 5 minutes
0 * * * * every hour on the hour
0 9 * * * every day at 09:00
0 9 * * 1-5 weekdays at 09:00
*/5 means “every five minutes starting at zero”: 0, 5, 10, … 55. In 0 9 * * 1-5 the minute and hour are fixed, so the job runs once per day and only on weekdays.
Day of month and weekday combine with OR
In the Vixie cron standard, restricting both the day of month and the weekday combines them with OR, not AND. 0 0 1 * 1 therefore means “on the first of the month or on Mondays”, not “on the first only when it is a Monday”. This single rule causes more production surprises than any other part of cron. Leave one field as * if you only mean one of them.
Sub-minute schedules
Unix cron works in minutes. A job that must run every 30 seconds needs a six-field format such as Quartz, Spring or AWS EventBridge, or a timer inside the application. CronPulse reads six- and seven-field expressions as well.
A checking habit
Before a schedule goes live, confirm three things: the next run times land on the weekday and hour you intended; the server's time zone is what you think it is (often UTC or the OS default); and the job still behaves on the daylight saving change days. The analyzer on this site shows all three on one screen.
Paste an expression and see its next run times right away.
Open CronPulseFrequently asked questions
Is Sunday 0 or 7 in cron?
Both 0 and 7 mean Sunday in Unix/Vixie cron. Monday is 1 and Saturday is 6. The six-field Quartz and AWS EventBridge formats number days differently: 1 is Sunday and 7 is Saturday. Check the format before copying an expression.
What does `0 0 1 * 1` mean?
Under the Vixie standard it means 00:00 on the first of the month OR on Mondays, because restricting both day-of-month and day-of-week combines them with OR. If you need the first only when it falls on a Monday, add a filter in the application or use a scheduler that supports AND.
Sources
Related reading
- Cron special characters: *, /, -, commas, ?, L, W and #The eight symbols that make cron expressive, what each one means, and where implementations disagree.
- Five-field Unix cron versus six-field Quartz and EventBridgeSeconds, weekday numbers, the ? rule and the year field: what changes when you move a schedule between cron dialects.
- Daylight saving and cron: the day 02:30 disappearsHow clock changes affect cron runs, and how to move jobs out of the 2–3 AM danger window.
- Idempotency: stopping the autumn duplicate runKey design, locking and notification patterns that keep a job safe when the same wall clock appears twice.