Developer Toolbox

Cron Cheatsheet

The five fields of a cron expression, the characters that go in them, and ready-made schedules written out for the platforms you are likely to deploy to.

Open Cron Parser Paste any expression to see what it means and when it runs next.

The five fields

PositionFieldValuesNotes
1Minute0-59
2Hour0-23In the server's time zone, or UTC on most hosted platforms.
3Day of month1-31A day a month doesn't have is skipped, not moved: 31 runs seven times a year.
4Month1-12 or JAN-DEC
5Day of week0-7 or SUN-SATBoth 0 and 7 are Sunday; 1 is Monday.

Special characters

*Every value of the field.
,A list: 1,15 is the 1st and the 15th.
-A range: 1-5 is 1 to 5, both included.
/A step: */10 is every 10th value from the first; 5-59/15 starts at 5.
L W # ?Last, weekday, nth weekday, no value: Quartz, Spring and AWS, not crontab.

Shorthands

@hourly0 * * * *
@daily, @midnight0 0 * * *
@weekly0 0 * * 0
@monthly0 0 1 * *
@yearly, @annually0 0 1 1 *
@rebootOnce, when the cron daemon starts

The trap: both day fields set

When day of month and day of week are both restricted (neither is *), cron runs when either one matches. 0 0 13 * 5 runs on every 13th and on every Friday, not only on Friday the 13th. With one of them left as *, the other alone decides.

Steps restart every hour

A step counts within its field, from the start of the range, and begins again when the next hour or day starts. */7 * * * * runs at :49 and :56 and then at :00, four minutes later. Steps that divide 60 (or 24 for hours) keep an even rhythm; for any other interval use a systemd timer with OnBootSec= and OnUnitActiveSec=.

Every 5 minutes on each platform

PlatformWritten asWhat differs
Linux crontab*/5 * * * *Five fields, in the server's local time zone. A % in the command has to be escaped as \%.
GitHub Actions- cron: '*/5 * * * *'Five fields, in UTC unless a timezone (an IANA name such as Europe/Warsaw) is set next to cron. Default branch only. The shortest interval is 5 minutes; when GitHub is busy, runs start late and some are dropped.
Kubernetes CronJobschedule: "*/5 * * * *"Five fields, in the controller's time zone unless spec.timeZone is set (Kubernetes 1.27 and later). concurrencyPolicy decides what happens when runs overlap.
systemd timerOnCalendar=*:0/5Its own calendar syntax, in a .timer unit, local time. hourly, daily and monthly match cron, but weekly means Monday. Persistent=true catches up on runs missed while the machine was off.
AWS EventBridgecron(0/5 * * * ? *)Six fields, the last one the year; one day field must be ?, and day of week 1 is Sunday. Rules run in UTC; EventBridge Scheduler accepts a time zone.
Quartz / Spring0 0/5 * * * ?Six fields, seconds first. Quartz needs ? in one of the day fields and counts Sunday as 1; Spring accepts ? and numbers days like cron.

Ready-made schedules

12 guides