Cron Expression Cheat Sheet

The Five Fields

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ minute (0–59)
β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ hour (0–23)
β”‚ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ day of month (1–31)
β”‚ β”‚ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ month (1–12 or JAN–DEC)
β”‚ β”‚ β”‚ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ day of week (0–6, Sun=0, or SUN–SAT)
β”‚ β”‚ β”‚ β”‚ β”‚
* * * * *

Special Characters

CharNameMeaningExample
*WildcardAny value* * * * * β€” every minute
,ListMultiple values1,15 * * * * β€” at minute 1 and 15
-RangeInclusive range0 9-17 * * * β€” hours 9 through 17
/StepEvery Nth value*/5 * * * * β€” every 5 minutes
?No valueSkip this field0 0 ? * MON β€” (Quartz/AWS only)
LLastLast day0 0 L * * β€” last day of month (Quartz)
WWeekdayNearest weekday0 0 15W * * β€” nearest weekday to 15th (Quartz)
#Nth weekdayNth occurrence0 0 ? * 5#3 β€” 3rd Friday (Quartz)

Field Ranges

FieldAllowed ValuesAllowed Special Characters
Minute0–59, - * /
Hour0–23, - * /
Day of month1–31, - * / ? L W
Month1–12 or JAN–DEC, - * /
Day of week0–6 or SUN–SAT (0=Sunday), - * / ? L #

Common Schedules

ExpressionDescription
* * * * *Every minute
*/5 * * * *Every 5 minutes
*/15 * * * *Every 15 minutes
*/30 * * * *Every 30 minutes
0 * * * *Every hour (at :00)
0 */2 * * *Every 2 hours
0 */6 * * *Every 6 hours
0 0 * * *Daily at midnight
0 6 * * *Daily at 6:00 AM
0 9 * * 1-5Weekdays at 9:00 AM
0 9,18 * * *Daily at 9 AM and 6 PM
0 0 * * 0Every Sunday at midnight
0 0 * * 1Every Monday at midnight
0 0 1 * *First of every month at midnight
0 0 1,15 * *1st and 15th at midnight
0 0 1 1 *January 1st at midnight (yearly)
30 2 * * 0Every Sunday at 2:30 AM

Crontab Shortcuts

These shortcuts work in Linux/macOS crontab:

ShortcutEquivalentDescription
@rebootβ€”Run once at startup
@yearly0 0 1 1 *Once a year (Jan 1)
@annually0 0 1 1 *Same as @yearly
@monthly0 0 1 * *Once a month (1st)
@weekly0 0 * * 0Once a week (Sunday)
@daily0 0 * * *Once a day (midnight)
@midnight0 0 * * *Same as @daily
@hourly0 * * * *Once an hour (:00)

Day of Week Numbering

DayStandard cronQuartz / Spring
Sunday0 (or 7)1
Monday12
Tuesday23
Wednesday34
Thursday45
Friday56
Saturday67

Platform Differences

PlatformFieldsSeconds?TimezoneNotes
Linux crontab5NoSystem TZSupports @shortcuts
Kubernetes CronJob5NoUTC (default)timeZone field since v1.27
GitHub Actions5NoUTC onlyMin 5-min interval; best-effort timing
GitLab CI5NoConfigurableSet in pipeline schedule UI
AWS EventBridge6No (year field)UTC or specifiedUses ?; format: cron(0 9 ? * MON *)
Spring @Scheduled6Yes (first field)App TZ0 0 9 * * MON-FRI (note: seconds first)
Quartz6–7Yes (first field)App TZSupports L, W, #, ?

Common Mistakes

MistakeWhy It’s WrongFix
* * * * * when you meant hourlyFires every minute (1440Γ—/day)0 * * * *
0 0 * * 1-7Day 7 is also Sunday (duplicate)0 0 * * 0-6 or 1-7 depending on system
Both DOM and DOW setStandard cron uses OR logicSet one to *; use ? in Quartz
*/7 expecting β€œevery 7 min” evenlyFires at 0,7,14,21,28,35,42,49,56 (9Γ— not 8Γ—)This is correct but uneven across hours
Forgetting Spring starts with seconds0 * * * * = every minute in SpringPrepend 0: 0 0 * * * *
Using @hourly in KubernetesNot supported; use 0 * * * *K8s only accepts 5-field expressions

Quick Examples by Use Case

Backups:

  • Full backup nightly at 3 AM: 0 3 * * *
  • Incremental every 6 hours: 0 */6 * * *
  • Weekly full on Sunday 2 AM: 0 2 * * 0

Monitoring:

  • Health check every 5 min: */5 * * * *
  • Disk space alert every hour: 0 * * * *
  • SSL cert check weekly: 0 9 * * 1

Reports:

  • Daily digest at 8 AM: 0 8 * * *
  • Weekly report Monday 9 AM: 0 9 * * 1
  • Monthly billing on the 1st: 0 8 1 * *

Maintenance:

  • Log cleanup daily at 4 AM: 0 4 * * *
  • Cache flush every 15 min: */15 * * * *
  • DB vacuum on Sunday 3 AM: 0 3 * * 0

Tools and Resources

cron scheduling linux devops reference

Related Tools

More Cheat Sheets