Cron cheat sheet
This cron cheat sheet fits crontab syntax on one printable page: the five time fields and their ranges, the * , - / characters, the @daily style macros, 20 ready-made schedules, the crontab commands and the gotchas that make jobs fail silently.
Fits one page: A4, Letter.
cron
Five-field crontab syntax, 20 common schedules and platform quirks
The five fields
- 0-59Minute
- 0-23Hour
- 1-31Day of month
- 1-12Month JAN-DEC
- 0-6Day of week Sunday = 0 (7 is also Sunday in cronie, Debian, node-cron, Spring); SUN-SAT
A crontab line
- */5 * * * * /usr/local/bin/job.sh >> /var/log/job.log 2>&1minute hour day-of-month month day-of-week command
Special characters
- *Every value of the field
* * * * *every minute - ,List of values
0 9,17 * * *at 09:00 and 17:00 - -Inclusive range
0 9 * * 1-5Monday to Friday - /Step, within the field
*/15 * * * *minutes 0, 15, 30, 45 - a-b/nStep inside a range
0 1-23/2 * * *odd hours
L (last), W (nearest weekday), # (nth weekday) and ? (no value) are Quartz extensions. Spring, node-cron and Cloudflare accept most of them; crontab, GitHub Actions, Kubernetes and Vercel don’t.
Macros
- @yearly0 0 1 1 *January 1 at 00:00 (@annually)
- @monthly0 0 1 * *The 1st of each month at 00:00
- @weekly0 0 * * 0Sunday at 00:00
- @daily0 0 * * *Every day at 00:00 (@midnight)
- @hourly0 * * * *Minute 0 of every hour
- @rebootOnce when the cron daemon starts
20 common schedules
- * * * * *At the start of every minute
- */5 * * * *At minutes 0, 5, 10, …, 55 of every hour
- */10 * * * *At minutes 0, 10, 20, 30, 40 and 50
- */15 * * * *At :00, :15, :30 and :45 of every hour
- */30 * * * *At minutes 0 and 30 of every hour
- 0 * * * *At minute 0 of every hour (
@hourly) - 0 */2 * * *At minute 0 of every even hour
- 0 */6 * * *At 00:00, 06:00, 12:00 and 18:00
- 0 */12 * * *At 00:00 and 12:00
- 0 9,21 * * *At 09:00 and 21:00
- 0 0 * * *Once a day at 00:00 (
@daily) - 0 9 * * *Once a day at 09:00
- 0 0 * * 1-5At 00:00, Monday to Friday
- 0 9 * * 1-5At 09:00, Monday to Friday
- 0 0 * * 0,6At 00:00 on Saturday and Sunday
- 0 0 * * 1At 00:00 every Monday
- 0 0 * * 0Once a week, Sunday at 00:00 (
@weekly) - 0 0 1 * *Once a month, the 1st at 00:00 (
@monthly) - 0 0 1 1,4,7,10 *Jan 1, Apr 1, Jul 1 and Oct 1 at 00:00
- 0 0 1 1 *Once a year, January 1 at 00:00 (
@yearly)
Gotchas
- \%
%in a command becomes a newline: escape it as\% - PATHJobs get a minimal environment: use absolute paths
- TZServer local time; cronie reads
CRON_TZ. Hosted cron is mostly UTC - 1 * 1Day of month and day of week both set: runs when EITHER matches
- */7Steps restart each hour: :56 then :00 is a 4-minute gap
- 2>&1Output is mailed or lost: redirect to a log file
crontab commands
- crontab -eEdit your crontab in $VISUAL or $EDITOR
- crontab -lPrint your crontab
- crontab -rDelete your whole crontab, no undo (-i asks first)
- sudo crontab -u <user> -eEdit another user's crontab
Where it runs
- crontab (cronie, Debian)TZ: Server, or
CRON_TZ(cronie). min: 1 minute. 0-7, names; macros; noL - GitHub ActionsTZ: UTC, or
timezone. min: 5 minutes, may be delayed. 0-6, names; no macros - Kubernetes CronJobTZ:
spec.timeZone, else controller’s zone. min: 1 minute. 0-6, names; macros;?=* - VercelTZ: UTC only. min: 1 minute (Pro), 1 day (Hobby). 0-6; no names; not both day fields
- Cloudflare WorkersTZ: UTC only. min: 1 minute. 1 = Sunday … 7 = Saturday;
L,W,# - node-cron 4.xTZ: Process, or
timezoneoption. min: 1 second. 0-7, names;L,W,#; day fields ANDed - systemd timerTZ: System, or zone suffix. min: Sub-second (set
AccuracySec). Own syntax:Mon..Fri *-*-* 09:00 - Spring @ScheduledTZ: JVM, or
zone. min: 1 second. 0-7, names;L,W,#; macros - QuartzTZ: JVM, or trigger zone. min: 1 second. 1 = Sunday … 7 = Saturday;
?required
What is on the sheet
The 20 schedules are the ones people search for most, from every minute to once a year, each with the exact expression and when it fires. Every one links to a page that shows its next run times and the same schedule for GitHub Actions, Kubernetes, Vercel, Cloudflare, node-cron, systemd and Spring.
The platform block is there because the same five fields do not behave the same everywhere: Vercel and Cloudflare always run in UTC, GitHub Actions will not go below 5 minutes, and Cloudflare and Quartz count weekdays from 1 = Sunday. Those differences are where copied expressions break.
How to print it on one page
Pick the paper above the sheet and press Print / Save as PDF. The page measures the sheet at that paper width and scales it to fill one page, never below 7pt, then hides the site header, footer, ads and buttons. It always prints black on white, whatever theme you are reading in.
In the print dialog keep Scale on Default (100%) and Margins on Default. To get a PDF, choose Save as PDF as the destination. Safari ignores the paper size a page asks for, so select the same paper in its dialog.
Embed or link to this cheat sheet
Linking to this page from your docs, wiki or README is the best way to share it: readers always get the current version and the print button. Copy one of these:
<a href="https://www.arielton.com/cheatsheets/cron">Cron cheat sheet (printable)</a> by <a href="https://www.arielton.com/">Arielton Oberek</a>[Cron cheat sheet (printable)](https://www.arielton.com/cheatsheets/cron) by [Arielton Oberek](https://www.arielton.com/)If your team wants the same treatment for an internal API, a CLI or a style guide, write to contact@arielton.com.
Frequently asked questions
- What does */5 * * * * mean in cron?
- Run at every minute divisible by 5, that is minutes 0, 5, 10 and so on up to 55, in every hour of every day, in the time zone of the machine or service that runs it.
- How do I run a cron job every weekday at 9 AM?
- Use 0 9 * * 1-5: minute 0, hour 9, any day of the month, any month, Monday (1) through Friday (5). On Vercel or Cloudflare that is 09:00 UTC, so shift the hour for your time zone.
- Why does my script work in the terminal but not from cron?
- Cron starts jobs with a minimal environment: /bin/sh, a short PATH and none of your shell profile. Use absolute paths, set variables at the top of the crontab, escape % as \%, and redirect output to a log file so you can read the error.
- Is Sunday 0 or 7 in cron?
- Both, in cronie, Debian cron, node-cron and Spring. GitHub Actions, Kubernetes and Vercel accept 0 to 6 only, so 0 is the portable choice. Cloudflare and Quartz are the odd ones out: there 1 is Sunday and 7 is Saturday.
Last reviewed by Arielton Oberek.