Cron Expressions Cheat Sheet
Cron, decoded: the five fields, every special character, 20+ copy-paste schedule recipes, the @-shorthands, and the gotchas that bite every beginner.
The five fields
A cron line is five time fields followed by the command. Read left to right — from fine to coarse:
| # | Field | Values | Names |
|---|---|---|---|
| 1 | Minute | 0–59 | — |
| 2 | Hour | 0–23 | — |
| 3 | Day of month | 1–31 | — |
| 4 | Month | 1–12 | JAN–DEC |
| 5 | Day of week | 0–7 | SUN–SAT (0 and 7 both mean Sunday) |
┌ minute (0–59)
│ ┌ hour (0–23)
│ │ ┌ day of month (1–31)
│ │ │ ┌ month (1–12)
│ │ │ │ ┌ day of week (0–7)
│ │ │ │ │
* * * * * /usr/bin/my-backup # runs every minute
Special characters
| Char | Meaning | Example |
|---|---|---|
* | every possible value | 0 * * * * — at minute 0 of every hour |
, | list of values | 0 8,12,18 * * * — 08:00, 12:00, 18:00 |
- | range | 0 9-17 * * * — 09:00 through 17:00 |
/ | step over a range | */10 * * * * — every 10 minutes |
/ after * | every N over the full range | 0 */2 * * * — every 2 hours |
*/15 9-17 * * 1-5 # every 15 min, 09:00–17:59, Mon–Fri
0 0 1,15 * * # 00:00 on the 1st and 15th
30 4 * * MON,WED # 04:30 on Mondays and Wednesdays
Copy-paste recipes
* * * * * # every minute
*/5 * * * * # every 5 minutes
*/15 * * * * # every 15 minutes
0 * * * * # every hour, at minute 0
30 * * * * # every hour, at minute 30
0 */2 * * * # every 2 hours
0 9 * * * # every day at 09:00
0 2 * * * # every day at 02:00 (local server time!)
0 9 * * 1-5 # weekdays (Mon–Fri) at 09:00
0 9 * * MON-FRI # same, with names
0 0 * * 0 # every Sunday at midnight
0 22 * * 5 # every Friday at 22:00
0 0 1 * * # the 1st of every month, midnight
0 6 1 * * # the 1st of every month at 06:00
0 0 1 1 * # once a year: Jan 1 at midnight
0 12 * * * # noon daily — lunch reminder
5 4 * * * # daily at 04:05 (spread load off the hour)
0 8-18/2 * * * # every 2 hours between 08:00 and 18:00
0 0 * * 6,0 # weekends (Sat and Sun) at midnight
Shorthand strings
@reboot command # once, at startup
@yearly command # = 0 0 1 1 *
@annually command # same as @yearly
@monthly command # = 0 0 1 * *
@weekly command # = 0 0 * * 0
@daily command # = 0 0 * * *
@midnight command # same as @daily
@hourly command # = 0 * * * *
Managing your crontab
crontab -e # edit your crontab (opens $EDITOR)
crontab -l # list your current jobs
crontab -r # REMOVE your crontab — no confirmation!
crontab -u bob -l # view another user's crontab (as root)
crontab - # install a crontab from stdin
# set variables at the top of the crontab — they apply to every job
SHELL=/bin/bash
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
MAILTO=me@example.com # where job output goes; MAILTO="" disables mail
0 3 * * * /home/bob/backup.sh >> /var/log/backup.log 2>&1
# ^ log it yourself: no output = no mail = no clue
Gotchas that bite beginners
# 1. cron runs with a bare environment: PATH is tiny, no aliases,
# no ~/.bashrc. Use absolute paths, or set PATH/SHELL at the top.
# 2. Day-of-month AND day-of-week is an OR, not an AND:
0 9 1 * 1 # → runs on the 1st of the month AND on every Monday —
# not "Monday the 1st". This surprises everyone once.
# 3. % is special in the command field: cron turns it into a newline.
# Writing date "+%Y-%m-%d" breaks — escape it: date "+\%Y-\%m-\%d".
# 4. Times are the SERVER's local time, not yours. On a VPS check
# `timedatectl`. Set TZ=America/New_York inside the crontab to pin it.
# Daylight-saving shifts can skip or double-fire jobs — avoid 02:00–03:00.
# 5. There is no seconds field in classic cron. "Every 10 seconds"
# needs a sleep trick or a systemd timer:
* * * * * sleep 10; /usr/bin/poll # at :00 and :10 every minute
# 6. Anything a job prints is mailed to MAILTO (or the local mailbox).
# Redirect to a log, or to /dev/null once you trust it.
# 7. @reboot runs before the network is always up — add a sleep or retry
# if your job needs the internet on boot.
Not quite cron: quartz & GitHub Actions
# Quartz (Java schedulers) adds a SECONDS field first, 6 or 7 fields:
0 15 10 * * ? # 10:15:00 daily — ? means "no specific value"
# GitHub Actions `schedule:` uses normal cron, but:
# - always UTC, - minimum interval 5 minutes,
# - busy repos may see their job start late.