Cron Syntax

┌───────────── minute (0-59) │ ┌───────────── hour (0-23) │ │ ┌───────────── day of month (1-31) │ │ │ ┌───────────── month (1-12 or JAN-DEC) │ │ │ │ ┌───────────── day of week (0-6 or SUN-SAT) │ │ │ │ │ * * * * * command_to_run

Special Characters

CharMeaningExample
*Any value* * * * *
,Value list1,15 * * * *
-Range1-5 * * * *
/Step values*/15 * * * *

Special Strings

StringEquivalent
@yearly0 0 1 1 *
@monthly0 0 1 * *
@weekly0 0 * * 0
@daily0 0 * * *
@hourly0 * * * *
@rebootRun at startup

Common Patterns

* * * * *Every minute
*/5 * * * *Every 5 minutes
*/15 * * * *Every 15 minutes
0 * * * *Every hour
0 */2 * * *Every 2 hours
0 */6 * * *Every 6 hours
0 0 * * *Daily midnight
0 9 * * *Daily 9am
0 0 * * 0Weekly Sunday
0 0 * * 1Weekly Monday
0 0 1 * *Monthly 1st
0 0 1 1 *Yearly Jan 1

Business Hours

0 9-17 * * 1-5Hourly 9-5 weekdays
*/30 9-17 * * 1-5Every 30min business
0 9 * * 1-5Weekdays 9am
0 17 * * 5Friday 5pm
0 0 * * 6,0Weekends midnight

Common Tasks

0 2 * * *Nightly backup (2am)
*/5 * * * *Health check
0 0 * * 0Weekly log rotation
0 4 * * *Sitemap update
0 6 1 * *Monthly report

Day of Week Reference

Value0123456
DaySunMonTueWedThuFriSat
💡 Tip: In some systems, 7 also represents Sunday

Month Reference

Value123456789101112
MonthJanFebMarAprMayJunJulAugSepOctNovDec

Platform Differences

AWS CloudWatch/EventBridge

6 fields: seconds minute hour day month day-of-week year

0 */5 * * * ? (every 5 min)

Kubernetes CronJob

Standard 5-field with timezone support (v1.27+)

schedule: "*/5 * * * *"

GitHub Actions

Standard 5-field, runs in UTC timezone

cron: '0 9 * * 1-5'

Jenkins

Uses H for hash-based distribution

H */4 * * *