Cron Expression Examples
Copy a ready-made schedule and see exactly when it runs.
About Cron examples
A cron expression schedules a recurring job with five fields: minute, hour, day of month, month and day of week. It's used by crontab on Linux and macOS, Kubernetes CronJobs, GitHub Actions (on: schedule), and most cloud schedulers. The examples below use standard five-field syntax; paste any of them into the cron expression parser to check it reads the way you expect.
Some schedulers extend the format. Quartz (Java) and Spring add a seconds field at the start and use ? in one day field, AWS EventBridge has six fields with a year at the end, and several support L for the last day of the month. Standard cron can't express 'the last day of the month' directly; a common workaround is to run on days 28-31 and have the job check whether tomorrow is the 1st.
45 entries
Common schedules
| Expression | Runs | Note |
|---|---|---|
| * * * * * | Every minute | |
| */5 * * * * | Every 5 minutes | At minutes 0, 5, 10 ... 55 |
| */10 * * * * | Every 10 minutes | |
| */15 * * * * | Every 15 minutes | At :00, :15, :30 and :45 |
| */30 * * * * | Every 30 minutes | |
| 0 * * * * | Every hour, on the hour | |
| 15 * * * * | Every hour at 15 minutes past | |
| 0 */2 * * * | Every 2 hours | At 00:00, 02:00, 04:00 ... |
| 0 */6 * * * | Every 6 hours | At 00:00, 06:00, 12:00 and 18:00 |
| 0 0 * * * | Every day at midnight | Same as @daily |
| 0 3 * * * | Every day at 03:00 | A common time for backups |
| 0 9 * * * | Every day at 09:00 | |
| 30 18 * * * | Every day at 18:30 | |
| 0 9,17 * * * | Every day at 09:00 and 17:00 | |
| 0 9-17 * * * | Every hour from 09:00 to 17:00 | |
| 0 9 * * 1-5 | Weekdays at 09:00 | Monday (1) to Friday (5) |
| */15 9-17 * * 1-5 | Every 15 minutes from 09:00 to 17:45 on weekdays | The hour range 9-17 includes 17:00-17:59 |
| 0 22 * * 1-5 | Weekdays at 22:00 | |
| 0 10 * * 6,0 | Saturdays and Sundays at 10:00 | |
| 0 0 * * 0 | Every Sunday at midnight | Same as @weekly; 7 also means Sunday |
| 0 8 * * 1 | Every Monday at 08:00 | |
| 0 17 * * 5 | Every Friday at 17:00 | |
| 5 4 * * 0 | Every Sunday at 04:05 | |
| 0 0 1 * * | First day of every month at midnight | Same as @monthly |
| 0 0 15 * * | The 15th of every month at midnight | |
| 0 0 1,15 * * | The 1st and 15th of every month | |
| 0 0 1 */3 * | Quarterly: January, April, July and October 1st | Months 1, 4, 7 and 10 |
| 0 0 1 1 * | Once a year on January 1st at midnight | Same as @yearly and @annually |
| 0 12 * 12 * | Every day in December at noon | |
| 0 0 1 * 1 | The 1st of the month AND every Monday | Day of month and day of week combine with OR in standard cron |
The five fields
In order, separated by spaces.
| Field | Allowed values | Note |
|---|---|---|
| Minute | 0-59 | |
| Hour | 0-23 | |
| Day of month | 1-31 | |
| Month | 1-12 or JAN-DEC | |
| Day of week | 0-7 or SUN-SAT | 0 and 7 are both Sunday |
Operators
| Symbol | Meaning | Example |
|---|---|---|
| * | Every value | * in the hour field: every hour |
| , | A list of values | 1,15 in day of month: the 1st and 15th |
| - | A range | 1-5 in day of week: Monday to Friday |
| / | A step | */10 in minutes: every 10 minutes; 5-59/10: 5, 15, 25 ... |
@ nicknames
Supported by Vixie cron, cronie and many schedulers, but not all: check yours.
| Nickname | Runs | Equivalent |
|---|---|---|
| @yearly | Once a year | 0 0 1 1 * (also @annually) |
| @monthly | Once a month | 0 0 1 * * |
| @weekly | Once a week, Sunday midnight | 0 0 * * 0 |
| @daily | Once a day at midnight | 0 0 * * * (also @midnight) |
| @hourly | Once an hour | 0 * * * * |
| @reboot | Once, when the cron daemon starts | Not a time schedule; unsupported in Kubernetes and most cloud schedulers |
Good to know
Time zones
Cron runs in the scheduler's time zone. crontab uses the server's local time (often UTC on servers), and GitHub Actions schedules are always UTC. Kubernetes CronJobs use the controller's time zone unless you set spec.timeZone.
Day of month and day of week
If both fields are restricted (neither is *), standard cron runs the job when either one matches. 0 0 13 * 5 runs on every 13th and on every Friday, not only on Friday the 13th.
More references
- HTTP status codesEvery HTTP status code and what it means
- MIME typesCommon MIME types by file extension
- ASCII tableAll 128 ASCII codes in dec, hex, octal and binary
- HTML entitiesNamed HTML entities with their codes
- Regex cheat sheetRegular expression syntax at a glance
- Chmod examplesCommon Unix permissions like 644 and 755
- Unix timestamp referenceNotable epochs, the 2038 problem and code
- Git cheat sheetEveryday Git commands in one place
- Markdown cheat sheetMarkdown and GitHub Flavored syntax