Cheat sheet · checked 2026-11-18
Crontab cheat sheet.
Everything you need to write a crontab line, on one page: the five fields, the operators, the @ shortcuts, common schedules, the crontab commands and the mistakes that stop jobs from running. Click any expression to see its next run times.
Crontab cheat sheetcrontabsheet.com/crontab-cheat-sheet.html · 2026-11-18
Line format
┌──── minute
│ ┌──── hour
│ │ ┌──── day of month
│ │ │ ┌──── month
│ │ │ │ ┌──── day of week
* * * * * command
| Field | Values | Names / notes |
|---|
| minute | 0-59 | |
| hour | 0-23 | |
| day of month | 1-31 | |
| month | 1-12 | jan-dec |
| day of week | 0-7 | sun-sat · 0 and 7 are Sunday |
In /etc/crontab and /etc/cron.d/* a user name goes between the schedule and the command: 0 2 * * * root /usr/local/bin/backup.
Operators
Names work in ranges and lists (mon-fri, jan,jul) on Debian/Ubuntu, cronie and BusyBox, though Debian’s man page says otherwise. Full names like monday are rejected.
Shortcuts
| String | Runs | Same as |
|---|
@reboot | once, when cron starts | |
@yearly | once a year | 0 0 1 1 * |
@annually | same as @yearly | 0 0 1 1 * |
@monthly | once a month | 0 0 1 * * |
@weekly | once a week | 0 0 * * 0 |
@daily | once a day | 0 0 * * * |
@midnight | same as @daily | 0 0 * * * |
@hourly | once an hour | 0 * * * * |
The crontab command
| Command | Does |
|---|
crontab -e | edit your crontab (installed when you save) |
crontab -l | print your crontab |
crontab -r | delete your crontab, no undo |
crontab -i -r | ask before deleting |
crontab -u alice -l | another user's crontab (root) |
crontab -n file | check a file without installing it (Debian) |
crontab file | replace your crontab with file |
Where jobs live
crontab -eyour own crontab (stored in /var/spool/cron/crontabs on Debian) |
/etc/crontabsystem crontab, with a user field |
/etc/cron.d/system and package files, with a user field |
/etc/cron.daily/scripts run by run-parts (also hourly, weekly, monthly) |
cron rereads changed crontabs every minute; no restart needed.
Variables in a crontab
PATH=/usr/local/bin:/usr/bin:/binset your own; cron’s default PATH is short |
SHELL=/bin/bashjobs run with sh unless you set this |
MAILTO=you@example.comwhere output is mailed; MAILTO="" sends no mail |
CRON_TZ=Europe/Londoncronie only: time zone for the jobs below it. Debian cron does not use it for scheduling |
Gotchas
% ends the command. In the command part, an unescaped % becomes a newline and the rest is sent as input. Write date +\%F.- Day of month and day of week are OR’d.
0 0 1-7 * 1 runs on days 1-7 and every Monday, not on the first Monday. If either field starts with * (even */2), both must match. How to run on the first Monday. - Jobs get a bare environment.
sh, not your login shell, and a much shorter PATH. Use full paths or set PATH= at the top of the crontab. Details. - The last line needs a newline. cron requires every entry to end in a newline; a file without one counts as broken.
- Backwards ranges never run.
0 22-2 * * * is accepted but selects nothing. Write 0 22,23,0,1,2 * * *. - There is no “every 2 weeks”. Steps restart every month or week. Run weekly and test the week number inside the command.
/etc/cron.d file names can’t contain dots. Letters, digits, _ and - only, or Debian cron ignores the file. Same for the /etc/cron.daily-style folders (run-parts rules).- Clock changes skip or delay runs. On Linux a job in the skipped hour runs right after the change; the repeated hour is not re-run. Kubernetes runs it twice. Check your schedule.
Quartz, Spring & AWS extras
Not valid in Linux crontab. Quartz has a seconds field first; AWS has a year field last. Quartz · AWS · Spring
Questions
What are the five fields in a crontab line?
Minute (0-59), hour (0-23), day of month (1-31), month (1-12 or jan-dec) and day of week (0-7, where 0 and 7 are Sunday, or sun-sat), followed by the command. /etc/crontab and files in /etc/cron.d add a user name between the schedule and the command.
Can I use mon-fri or jan,jul in a crontab?
Yes. Debian/Ubuntu cron, cronie and BusyBox accept three-letter names in ranges and lists, such as 0 9 * * mon-fri, even though Debian's crontab(5) page says names can't be used in ranges or lists. Full names like monday are rejected.
Why does my % sign break the cron job?
In the command part of a crontab line, cron turns an unescaped % into a newline and sends the rest to the command as input. Escape it as \%, for example date +\%F.
How do I run a cron job on the first Monday of the month?
Not with 0 0 1-7 * 1, which runs on days 1 to 7 and on every Monday. Use 0 0 1-7 * * and test the weekday in the command, for example [ "$(date +\%u)" = 1 ] && your-command.
Sources: Debian crontab(5), crontab(1) and cron(8), checked 2026-11-18. Name handling and backwards ranges checked against the Debian, cronie and BusyBox parsers we test against.