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
| Position | Field | Values | Notes |
|---|---|---|---|
| 1 | Minute | 0-59 | |
| 2 | Hour | 0-23 | In the server's time zone, or UTC on most hosted platforms. |
| 3 | Day of month | 1-31 | A day a month doesn't have is skipped, not moved: 31 runs seven times a year. |
| 4 | Month | 1-12 or JAN-DEC | |
| 5 | Day of week | 0-7 or SUN-SAT | Both 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
| @hourly | 0 * * * * |
|---|---|
| @daily, @midnight | 0 0 * * * |
| @weekly | 0 0 * * 0 |
| @monthly | 0 0 1 * * |
| @yearly, @annually | 0 0 1 1 * |
| @reboot | Once, 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
| Platform | Written as | What 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 CronJob | schedule: "*/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 timer | OnCalendar=*:0/5 | Its 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 EventBridge | cron(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 / Spring | 0 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
- * * * * * Every minute
- */5 * * * * Every 5 minutes
- */10 * * * * Every 10 minutes
- */15 * * * * Every 15 minutes
- */30 * * * * Every 30 minutes
- 0 * * * * Every hour
- 0 */2 * * * Every 2 hours
- 0 */6 * * * Every 6 hours
- 0 0 * * * Every day at midnight
- 0 9 * * 1-5 Weekdays at 9 AM
- 0 0 * * 0 Every week
- 0 0 1 * * Every month