Common Schedules8
Step Values7
Ranges & Lists8
Common Cron Jobs8
Cron Expression Reference
Cron Format Overview
bash
# Cron expression format:
# ┌───────────── minute (0–59)
# │ ┌───────────── hour (0–23)
# │ │ ┌───────────── day of month (1–31)
# │ │ │ ┌───────────── month (1–12)
# │ │ │ │ ┌───────────── day of week (0–6, Sun=0)
# │ │ │ │ │
# * * * * *
# Every minute
* * * * *
# Every 5 minutes
*/5 * * * *
# At 9:00 AM on weekdays
0 9 * * 1-5
# First of every month at midnight
0 0 1 * *Field Definitions
| Position | Field | Allowed Values | Special Characters |
|---|---|---|---|
| 1 | Minute | 0 – 59 | * , - / |
| 2 | Hour | 0 – 23 | * , - / |
| 3 | Day of Month | 1 – 31 | * , - / ? L W |
| 4 | Month | 1 – 12 | * , - / (or Jan–Dec names) |
| 5 | Day of Week | 0 – 6 | * , - / ? L # (0 and 7 = Sunday) |
Special Characters
| Character | Name | Supported In | Description |
|---|---|---|---|
| * | Wildcard | All fields | Match any value. * in minute = every minute. |
| , | List | All fields | Enumerate specific values. 1,15,30 in minute = at those exact minutes. |
| - | Range | All fields | Inclusive range. 9-17 in hour = from 9:00 to 17:00. |
| / | Step | All fields | Step through values. */5 = every 5 units. 10-50/10 = 10, 20, 30, 40, 50. |
| ? | No value | DOM / DOW | Used when you specify DOM or DOW but not both. Not in standard Unix cron. |
| L | Last | DOM / DOW | L in DOM = last day of month. 5L in DOW = last Friday. Quartz only. |
| W | Weekday | DOM | Nearest weekday to given day. 15W = nearest weekday to 15th. Quartz only. |
| # | Nth day | DOW | Nth occurrence of day. 5#3 = 3rd Friday. Quartz only. |
Step and Range Examples
bash
# Step values with /
*/5 * * * * # Every 5 minutes (0, 5, 10, ..., 55)
*/15 * * * * # Every 15 minutes (0, 15, 30, 45)
0 */2 * * * # Every 2 hours (0:00, 2:00, 4:00, ...)
0 9-17/2 * * * # Every 2 hours from 9 AM to 5 PM
# Range examples with -
0 9-17 * * * # Every hour from 9 AM to 5 PM
0 0 * * 1-5 # Midnight on weekdays
0 0 * 6-8 * # Midnight every day in Jun, Jul, AugList Examples
bash
# List values with ,
0 9,12,18 * * * # At 9:00, 12:00, 18:00 every day
30 6 * * 1,3,5 # 6:30 AM on Mon, Wed, Fri
0 0 1,15 * * # Midnight on the 1st and 15th of each month
0 0 * 1,4,7,10 * # Midnight on the 1st day of quarterly months@Alias Shortcuts
| Alias | Equivalent | When It Runs |
|---|---|---|
| @yearly / @annually | 0 0 1 1 * | January 1st at midnight, once per year |
| @monthly | 0 0 1 * * | 1st day of every month at midnight |
| @weekly | 0 0 * * 0 | Every Sunday at midnight |
| @daily / @midnight | 0 0 * * * | Every day at midnight (00:00) |
| @hourly | 0 * * * * | Every hour at the start of the hour (:00) |
| @reboot | (special) | Once at system startup — not supported everywhere |
Common Examples
| Expression | Description |
|---|---|
| * * * * * | Every minute |
| */5 * * * * | Every 5 minutes |
| */15 * * * * | Every 15 minutes |
| */30 * * * * | Every 30 minutes |
| 0 * * * * | Every hour at :00 |
| 0 9 * * * | Every day at 9:00 AM |
| 0 9 * * 1-5 | Every weekday at 9:00 AM |
| 0 9,17 * * 1-5 | At 9 AM and 5 PM on weekdays |
| */15 9-17 * * 1-5 | Every 15 min during business hours (weekdays) |
| 0 0 * * 0 | Every Sunday at midnight |
| 0 0 1 * * | 1st of every month at midnight |
| 0 0 1 1 * | January 1st at midnight (yearly) |
| 0 0 * * 1 | Every Monday at midnight |
| 30 6 * * 1,3,5 | 6:30 AM on Mon, Wed, Fri |
| 0 12 15 * * | Noon on the 15th of every month |
| 0 2 * * * | Every day at 2:00 AM (common for backups) |
| 0 0 * 6-8 * | Midnight every day in June, July, August |
| 0 0 1,15 * * | Midnight on the 1st and 15th of each month |
| @daily | Every day at midnight (alias for 0 0 * * *) |
| @weekly | Every Sunday at midnight (alias for 0 0 * * 0) |
Month and Day Name Abbreviations
| Number | Month |
|---|---|
| 1 | January (Jan) |
| 2 | February (Feb) |
| 3 | March (Mar) |
| 4 | April (Apr) |
| 5 | May |
| 6 | June (Jun) |
| 7 | July (Jul) |
| 8 | August (Aug) |
| 9 | September (Sep) |
| 10 | October (Oct) |
| 11 | November (Nov) |
| 12 | December (Dec) |
| Number | Day |
|---|---|
| 0 or 7 | Sunday (Sun) |
| 1 | Monday (Mon) |
| 2 | Tuesday (Tue) |
| 3 | Wednesday (Wed) |
| 4 | Thursday (Thu) |
| 5 | Friday (Fri) |
| 6 | Saturday (Sat) |
Common Mistakes
| Mistake | Wrong | Correct | Explanation |
|---|---|---|---|
| 0-indexed day of week | 1 = Sunday | 0 = Sunday | Days of week start at 0 (Sunday). Monday is 1, Saturday is 6. |
| 1-indexed month | 0 = January | 1 = January | Months are 1-indexed. January = 1, December = 12. |
| DOM + DOW OR logic | Expects AND | Uses OR | If both DOM and DOW are specified, cron fires when EITHER matches, not both. |
| Minimum interval | Seconds | Minutes | Standard cron minimum granularity is 1 minute. Use systemd or another tool for sub-minute. |
| Year field | Adding 6th field | Use 5 fields | Standard cron has 5 fields. Some systems (Quartz) add a seconds field at position 1 or a year field at position 6. |
| Timezone | Assuming local time | Check server TZ | Cron runs in the server's timezone (often UTC in cloud environments). Set TZ explicitly if needed. |
Cron in Different Systems
| System | Fields | Notes |
|---|---|---|
| Unix/Linux cron | 5 (min hr dom mon dow) | Standard — no seconds field, no year field |
| Vixie cron | 5 | Most common Unix cron daemon; supports @aliases |
| Quartz Scheduler | 6–7 (sec min hr dom mon dow [year]) | Java scheduler — adds seconds and optional year |
| AWS EventBridge | 6 (min hr dom mon dow year) | Adds year field; uses ? for no-value in dom/dow |
| Kubernetes CronJob | 5 (standard) | Standard 5-field cron; no seconds field; TZ via .spec.timeZone |
| GitHub Actions | 5 (standard) | Minimum interval is every 5 minutes; no @aliases |
| systemd timers | Calendar events | Different syntax: OnCalendar=*:0/5 for every 5 min |