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
FieldValuesNames / notes
minute0-59
hour0-23
day of month1-31
month1-12jan-dec
day of week0-7sun-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

SymbolMeansExample
*every value* * * * *
,list0 6,18 * * *
-range0 9 * * 1-5
/step (after * or a range)*/15 * * * *
a-b/nstep inside a range0 9-17/2 * * *
mon, janthree-letter names, any case0 9 * * mon-fri

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

StringRunsSame as
@rebootonce, when cron starts
@yearlyonce a year0 0 1 1 *
@annuallysame as @yearly0 0 1 1 *
@monthlyonce a month0 0 1 * *
@weeklyonce a week0 0 * * 0
@dailyonce a day0 0 * * *
@midnightsame as @daily0 0 * * *
@hourlyonce an hour0 * * * *

Common schedules

Minutes

* * * * *Every minute
*/5 * * * *Every 5 minutes
*/15 * * * *Every 15 minutes
*/30 * * * *Every 30 minutes
10-40/15 * * * *At :10, :25 and :40

Hours

0 * * * *Every hour, on the hour
30 * * * *Every hour at :30
0 */2 * * *Every 2 hours
0 */6 * * *Every 6 hours
0 9-17 * * 1-5Hourly, 9 AM-5 PM, Mon-Fri

Days

0 0 * * *Every day at midnight
0 2 * * *Every day at 2 AM
30 4 * * *Every day at 4:30 AM
0 6,18 * * *6 AM and 6 PM
0 9 * * 1-59 AM, Monday to Friday

Weeks

0 9 * * 1Mondays at 9 AM
0 17 * * 5Fridays at 5 PM
0 0 * * 0Sundays at midnight
0 0 * * 0,6Saturdays and Sundays at midnight

Months and years

0 0 1 * *1st of every month
0 0 1,15 * *1st and 15th of every month
0 0 1 */3 *Quarterly: 1 Jan, Apr, Jul, Oct
0 0 1 1 *Once a year, 1 January

More in 80+ cron examples and common expressions explained.

The crontab command

CommandDoes
crontab -eedit your crontab (installed when you save)
crontab -lprint your crontab
crontab -rdelete your crontab, no undo
crontab -i -rask before deleting
crontab -u alice -lanother user's crontab (root)
crontab -n filecheck a file without installing it (Debian)
crontab filereplace 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

  1. % ends the command. In the command part, an unescaped % becomes a newline and the rest is sent as input. Write date +\%F.
  2. 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.
  3. 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.
  4. The last line needs a newline. cron requires every entry to end in a newline; a file without one counts as broken.
  5. Backwards ranges never run. 0 22-2 * * * is accepted but selects nothing. Write 0 22,23,0,1,2 * * *.
  6. There is no “every 2 weeks”. Steps restart every month or week. Run weekly and test the week number inside the command.
  7. /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).
  8. 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

CharMeansExample (Quartz)
?no specific value: required in one day field0 0 9 ? * MON-FRI
Llast day of month / last weekday N0 0 18 L * ?
Wnearest weekday to day N0 0 9 15W * ?
#Nth weekday of the month0 0 9 ? * 2#1
1-7day of week, 1 = Sunday (SUN-SAT)0 0 9 ? * 2-6

Not valid in Linux crontab. Quartz has a seconds field first; AWS has a year field last. Quartz · AWS · Spring

Other schedulers

SchedulerFieldsDay of weekTime zone
Debian / Ubuntu cron50-7; 0 and 7 are SundaySystem time zone
BusyBox crond (Alpine, Docker)50-6; 7 is a parse error and the line then runs every dayTime zone of the crond process
Kubernetes CronJob50-6; 7 is rejected.spec.timeZone (stable since 1.27); without it, the kube-controller-manager’s local zone
GitHub Actions50-6 or SUN-SATUTC by default; timezone: takes an IANA zone
AWS EventBridge Scheduler61-7 or SUN-SATAny IANA zone (--schedule-expression-timezone), or UTC
Google Cloud Scheduler50-6; 7 is also SundaySet per job (tz database name); default UTC
Azure Functions (NCRONTAB)60-6; 0 is SundayUTC; WEBSITE_TIME_ZONE app setting (not on Linux Consumption or Flex Consumption)
Quartz Scheduler (Java)6 or 71-7 or SUN-SATThe trigger’s time zone (CronScheduleBuilder.inTimeZone()); otherwise the JVM default
Spring (@Scheduled, CronExpression)60-7; 0 and 7 are Sundayzone attribute of @Scheduled; otherwise the server zone
Jenkins50-7; 0 and 7 are SundayJenkins server zone, or a TZ= line before the schedule

From the cron dialect registry, where each row links to the official docs.

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.