Cron Format & Syntax Cheatsheet
The cron format is five fields separated by spaces — minute, hour, day of month, month and day of week — and a job runs whenever the current time matches all five. Each field takes a number, a range, a list, a step, or * for “every value”.
┌───────────── minute (0–59)
│ ┌─────────── hour (0–23)
│ │ ┌───────── day of month (1–31)
│ │ │ ┌─────── month (1–12 or JAN–DEC)
│ │ │ │ ┌───── day of week (0–7 or SUN–SAT; 0 and 7 are Sunday)
│ │ │ │ │
* * * * * command to runThe cron format: five fields
The format dates back to the original Unix cron, and Vixie cron, cronie, Kubernetes CronJobs and GitHub Actions all read it the same way. The fields always come in this order, from the smallest unit of time to the largest, with the day of week last:
| # | FIELD | VALUES | NOTES |
|---|---|---|---|
| 1 | Minute | 0–59 | Minute past the hour. |
| 2 | Hour | 0–23 | 24-hour clock; 0 is midnight, 12 is noon. |
| 3 | Day of month | 1–31 | Days a month doesn't have are skipped. |
| 4 | Month | 1–12, JAN–DEC | Names aren't case-sensitive. |
| 5 | Day of week | 0–7, SUN–SAT | 0 and 7 are both Sunday. |
Operators
Four symbols cover every standard schedule, and they can be combined within a field.
| SYMBOL | MEANING | EXAMPLE | READS AS |
|---|---|---|---|
| * | Every value the field allows | * * * * * | every minute |
| , | A list of values | 0 8,17 * * * | at 08:00 and 17:00 |
| - | A range, including both ends | 0 9-17 * * * | every hour from 09:00 to 17:00 |
| / | A step through a range | */15 * * * * | every 15 minutes: :00, :15, :30, :45 |
A step always counts from the start of its range: */15 is shorthand for 0-59/15, and 10-50/20 gives 10, 30 and 50. Combining operators works too — 0 9-17/2 * * 1-5 runs at 9, 11, 13, 15 and 17 o'clock on weekdays.
Field by field
Minute (0–59)
The minute field is the one to double-check: * here means every minute, so an hourly job needs a number, not a star.
| VALUE | MEANING |
|---|---|
| 0 | on the hour |
| 30 | at half past |
| 0,30 | on the hour and at half past |
| */10 | every 10 minutes: 0, 10, 20, 30, 40, 50 |
| 5-59/10 | every 10 minutes starting at :05 |
Hour (0–23)
Hours use a 24-hour clock with no am or pm, and they're in the timezone of the machine running cron.
| VALUE | MEANING |
|---|---|
| 0 | midnight |
| 9 | 09:00 |
| 9-17 | every hour from 09:00 to 17:00 |
| */6 | 00:00, 06:00, 12:00 and 18:00 |
| 1-23/2 | every odd hour: 01:00, 03:00 … 23:00 |
Day of month (1–31)
Cron never moves a run to another day, so a date a month doesn't have — the 31st of April, say — is simply skipped. There's no symbol for “the last day”.
| VALUE | MEANING |
|---|---|
| 1 | the 1st |
| 15 | the 15th |
| 1,15 | the 1st and the 15th |
| 1-7 | the first seven days |
| */2 | odd days: 1, 3, 5 … 31 |
Month (1–12 or JAN–DEC)
Months count from 1, so a step such as */3 starts in January. Month names work in ranges too — JAN-MAR is January to March.
| VALUE | MEANING |
|---|---|
| 1 or JAN | January |
| 6-8 | June, July and August |
| */3 | January, April, July and October |
| 1,7 | January and July |
Day of week (0–7 or SUN–SAT)
The week starts on Sunday at 0; 7 is accepted as Sunday too, so 1-7 means Monday to Sunday. Day names work as single values, in lists (MON,WED,FRI) and in ranges (MON-FRI) — Vixie cron and cronie, which most Linux systems run, accept all three. The crontab man page still documents names as single values only, so numbers are the safest choice for other schedulers.
| VALUE | MEANING |
|---|---|
| 0 or 7 | Sunday |
| 1-5 | Monday to Friday |
| 6,0 | Saturday and Sunday |
| MON | Monday |
How day of month and day of week combine
The two day fields follow a special rule. If either one starts with * — plain *, or a step such as */2 — a day has to match both. If neither starts with *, cron runs the job on days that match either field. So 0 0 13 * 5 runs at midnight on the 13th of every month and on every Friday, not only on Friday the 13th, while 0 0 */2 * 1 runs only on odd-numbered days that are also Mondays.
To require both — “the first Monday”, “Friday the 13th” — restrict one field in the expression and check the other inside the command. The every Monday and every Friday pages show the pattern.
Special strings
Most crons accept these shortcuts in place of the five fields:
| SHORTCUT | SAME AS | RUNS |
|---|---|---|
| @reboot | — | Once, when the cron daemon starts (normally at boot) |
| @yearly, @annually | 0 0 1 1 * | Midnight on 1 January |
| @monthly | 0 0 1 * * | Midnight on the 1st of each month |
| @weekly | 0 0 * * 0 | Midnight at the start of Sunday |
| @daily, @midnight | 0 0 * * * | Midnight every day |
| @hourly | 0 * * * * | At minute 0 of every hour |
Writing a crontab line
A crontab line is the five fields followed by the command:
# m h dom mon dow command
30 2 * * * /usr/local/bin/backup.sh >> /var/log/backup.log 2>&1crontab -eedits your own crontab andcrontab -llists it.- System files —
/etc/crontaband the files in/etc/cron.d/— have an extra field naming the user to run as, between the schedule and the command. - Jobs run with a minimal environment;
PATHis often just/usr/bin:/bin. Use absolute paths, or setPATH=at the top of the crontab. - A
%in the command is turned into a newline, so escape it as\\%— for example indate +\\%F. - Output is emailed to the crontab's owner, or to the address in
MAILTO=, if the machine can send mail. Redirect it to a file to keep a log.
Non-standard syntax you might see
Other schedulers extend cron's syntax. None of these work in a standard crontab:
- A seconds field at the front — Quartz, Spring and several libraries use six or seven fields.
?for “no specific value” in one of the day fields — Quartz and AWS EventBridge require it.Lfor the last day of the month,Wfor the nearest weekday, and#for the nth weekday (6#3is the third Friday in Quartz, where Sunday is 1).Hin Jenkins, which picks a consistent pseudo-random value per job so thatH * * * *spreads hourly jobs across the hour.
Common mistakes
* 2 * * *runs every minute from 02:00 to 02:59 — sixty times. For once at 2am, write0 2 * * *.- Restricting both day fields and expecting AND:
0 0 1-7 * 1isn't “the first Monday”. - Scheduling on the 29th, 30th or 31st and expecting a run every month.
- Writing
24for midnight — the hour field stops at 23. - Forgetting that times are in the server's timezone, which is often UTC.
To check an expression against all of this, paste it into the cron expression validator, or browse the examples for ready-made schedules.
Frequently asked questions
What are the five fields of a cron expression?
In order: minute (0–59), hour (0–23), day of month (1–31), month (1–12) and day of week (0–7, where 0 and 7 are Sunday). They're separated by spaces, and the command to run follows the fifth field.
What does an asterisk mean in cron?
* means every value the field allows — every minute, every hour, every day and so on. A field set to * doesn't restrict the schedule at all.
What's the difference between a comma and a hyphen in cron?
A comma lists separate values — 1,15 is the 1st and the 15th. A hyphen is an inclusive range — 1-15 is every day from the 1st to the 15th.