Cron Syntax Cheat Sheet: 25 Real Schedules Explained
The five fields of a cron expression, wildcards, lists, ranges, steps and names, the day-of-month or day-of-week rule, plus 25 schedules you can use.

Cron runs commands on a schedule. The schedule lives in a crontab file, one job per line, and the time part of each line is a fixed sequence of five fields. Read them left to right and the rest is arithmetic. Read them in the wrong order and the job fires at hours you did not intend, or never fires at all.
The crontab(5) manual page lists the fields in this order: minute, hour, day of month, month, day of week. Everything after the fifth field is the command to run.
The five fields at a glance
- Minute, 0 to 59. When inside the hour the job starts.
- Hour, 0 to 23, in 24-hour time. 17 is 5 PM, 0 is midnight.
- Day of month, 1 to 31. The calendar day number.
- Month, 1 to 12, or a three letter name such as jan.
- Day of week, 0 to 7, where 0 and 7 both mean Sunday, or a name such as mon.
A job that runs every minute is written `* * * * *`, which reads as every minute, every hour, every day of the month, every month, every day of the week. A slightly more useful line looks like this:
30 5 * * * /usr/local/bin/backup.shThat is 05:30 every day. The command comes after the five fields, separated by whitespace.
Wildcards, lists, ranges, steps and names
- Wildcard `*` stands for every value in the field. The manual page describes it as first to last.
- List: comma separated values. `1,15` means the 1st and the 15th of the month, `mon,wed,fri` means those three weekdays.
- Range: two numbers joined by a hyphen. `9-17` covers 9 AM to 5 PM. Ranges are inclusive.
- Step: a range or a wildcard followed by `/n`. `*/15` in the minute field fires at minutes 0, 15, 30 and 45 of every hour.
- Names: the month and day of week fields accept the first three letters of the name, and case does not matter. `jan-mar` runs from January through March.
Steps apply inside their own field only. That trips people up more than any other rule. `*/15` in the minute field is four runs an hour, not a run every fifteen minutes around the clock, because the minute field restarts at the top of every hour. The manual page makes the same point with `*/23` in the hours field, which means hour 0 and hour 23 of each day rather than every 23 hours.
Sunday is both 0 and 7
The day of week field accepts 0 through 7, and the manual page states that 0 or 7 is Sunday. So `0 3 * * 0` and `0 3 * * 7` are the same schedule: 3 AM every Sunday. Using 0 lines up with the rest of the numeric fields, where counting starts at zero, and 1 is Monday.
Short forms: @daily and friends
The crontab(5) manual page lists a set of shortcuts that replace all five time fields. They are handy in scripts and self-documenting in a crontab file.
- @reboot: run once after reboot.
- @yearly and @annually: `0 0 1 1 *`, once a year on 1 January.
- @monthly: `0 0 1 * *`, once a month on the 1st.
- @weekly: `0 0 * * 0`, once a week on Sunday at midnight.
- @daily: `0 0 * * *`, once a day at midnight.
- @hourly: `0 * * * *`, once an hour on the hour.
The day-of-month or day-of-week rule
This is the rule that surprises people most. When both the day of month and the day of week fields are restricted, the job runs when either one matches. It does not wait for both.
The manual page uses `30 4 1,15 * 5` as its example. That job runs at 4:30 AM on the 1st and 15th of every month, and it also runs at 4:30 AM on every Friday.
The rule stays out of the way as long as one of the two fields is a wildcard. `0 12 * * 1` is every Monday at noon, because the day of month field is still `*` and only one field is restricted.
25 schedules worth copying
Every line below uses the standard five field format. Swap the command at the end for your own.
- `* * * * *` runs every minute.
- `*/2 * * * *` runs every other minute.
- `*/5 * * * *` runs every five minutes.
- `*/10 * * * *` runs every ten minutes.
- `*/15 * * * *` runs at minutes 0, 15, 30 and 45 of every hour.
- `0 * * * *` runs at the start of every hour.
- `30 * * * *` runs at half past every hour.
- `0 0 * * *` runs at midnight every day.
- `0 12 * * *` runs at noon every day.
- `0 9 * * *` runs at 9 AM every day.
- `0 0,12 * * *` runs at midnight and noon every day.
- `0 8-17 * * *` runs hourly from 8 AM to 5 PM.
- `0 9-17 * * 1-5` runs every hour from 9 AM to 5 PM on weekdays.
- `0 9 * * 1-5` runs at 9 AM on weekdays.
- `0 9 * * 1,3,5` runs at 9 AM on Monday, Wednesday and Friday.
- `0 9 * * mon` runs at 9 AM every Monday.
- `30 6 * * 0` runs at 6:30 AM every Sunday.
- `0 0 * * 0` runs at midnight on Sundays.
- `0 22 * * 1-5` runs at 10 PM on weekdays.
- `0 3 * * 1-5` runs at 3 AM on weekdays.
- `0 0 1 * *` runs at midnight on the first day of every month.
- `0 0 1 1 *` runs at midnight on 1 January every year.
- `0 12 1,15 * *` runs at noon on the 1st and the 15th of every month.
- `15 10 * * 6` runs at 10:15 AM every Saturday.
- `*/10 * * * 1-5` runs every ten minutes on weekdays only.
Time zones and daylight saving
Cron matches each field against the clock on the machine running the daemon, so a schedule follows the server's local time. Move the server, change its time zone, or move the job to a different host, and the same expression now fires at a different wall clock time.
The manual page spells out the daylight saving behaviour. Non-existent times, such as the missing hours during the conversion, never match, so a job scheduled during a missing hour does not run on that day. Times that occur twice, again during the conversion, cause matching jobs to run twice.
In many time zones the change lands in the small hours, roughly between 1 AM and 3 AM. A job set for 2 AM can be skipped on the spring forward date and run twice on the fall back date. Schedules outside that window are far less surprising.
- The manual page documents a CRON_TZ variable that sets the time zone for one crontab. Times in that table are read in that zone.
- Log timestamps are written in the local time of the daemon, so a log line and a CRON_TZ schedule can look like they disagree by an hour or two.
Testing a schedule before it goes live
- Translate the expression before you install it. The cron expression translator turns a cron line into plain English and back, which catches a swapped field faster than reading five numbers left to right.
- Check the syntax without installing the file. On systems running cronie, the `crontab -T` option tests a crontab file's syntax and stops at the first problem it finds.
- Run the command by hand first. Cron uses a minimal environment: SHELL is set to /bin/sh, and HOME and LOGNAME come from the account's passwd entry. Use full paths for the command and for any file it touches.
- Escape percent signs. The manual page notes that an unescaped `%` in a command turns into a newline, and everything after it is sent to the command as standard input. A date format such as `date +%d` needs a backslash.
- Send the output somewhere you will read it. Cron mails output to the crontab owner by default, so set MAILTO to an address you check or redirect to a log file with `>> /var/log/myscript.log 2>&1`.
- Give it a minute to start. The daemon examines crontab entries every minute, so a new job may not run until the next minute boundary.
A Unix timestamp pins an exact instant. When you want to confirm a schedule lands on the date you expect, take the next run time, convert it to a timestamp with the Unix timestamp converter, and read it back in your own time zone.
Mistakes that show up again and again
- Field order. The minute comes first and the month comes fourth. `0 6 1 * *` is 6 AM on the 1st of every month, while `0 6 1 1 *` is 6 AM on 1 January.
- Steps reset with their field. `*/15` in the minute field is four runs an hour, not a run every fifteen minutes.
- Sunday numbering. 0 and 7 are both Sunday and 1 is Monday, which does not match the calendar order most people carry in their head.
- Missing fields. Cron expects five of them. Four is a syntax error, not an implied midnight.
- Forgetting the OR rule. `0 9 1 * 1` is not the first Monday of the month. It runs on the 1st of every month and on every Monday.
Most of these disappear once the expression has been read back to you in words. Translate it, check the timezone, then install it.
Sources
- Linux manual page, crontab(5): the field ranges, lists, ranges, steps and names, the day-of-month or day-of-week rule, the `@` shortcuts, the CRON_TZ variable and the daylight saving behaviour. man7.org
- Linux manual page, crontab(1): the `-l`, `-e` and `-T` options. man7.org
- Cron, Wikipedia: background on cron and the wider family of cron-like schedulers. en.wikipedia.org