Cron Expression Cheatsheet
All 5 cron fields, valid ranges, special characters, @-aliases, and Quartz extensions — on one page.
Try the interactive builder →Field Reference
| Position | Field | Allowed values | Special chars |
|---|---|---|---|
1 Minute | minute | 0–59 | * / - , |
2 Hour | hour | 0–23 | * / - , |
3 Day of month | dom | 1–31 | * / - , ? (Quartz: L W) |
4 Month | month | 1–12 or JAN–DEC | * / - , |
5 Day of week | dow | 0–6 or SUN–SAT | * / - , ? (Quartz: L #) |
0* Second (Quartz) | sec | 0–59 | * / - , |
Special Characters
| Character | Name | Meaning | Example |
|---|---|---|---|
* | Wildcard | Every valid value | * * * * * → every minute |
/ | Step | Every Nth value | */15 * * * * → every 15 min |
- | Range | From–to (inclusive) | 9-17 * * * * → 9am to 5pm |
, | List | Specific values | 0,15,30,45 * * * * |
? | No value | Quartz only — "any" for dom or dow | 0 12 15 * ? |
L | Last | Quartz only — last day of month or week | 0 0 L * ? → last day of month |
W | Weekday | Quartz only — nearest weekday to given date | 0 0 15W * ? |
# | Nth weekday | Quartz only — Nth occurrence in month | 0 0 ? * 2#1 → 1st Monday |
@-Aliases (Shorthand)
| Alias | Equivalent expression | Description |
|---|---|---|
@yearly / @annually | 0 0 1 1 * | Once a year, midnight Jan 1 |
@monthly | 0 0 1 * * | Once a month, midnight 1st |
@weekly | 0 0 * * 0 | Once a week, midnight Sunday |
@daily / @midnight | 0 0 * * * | Once a day, midnight |
@hourly | 0 * * * * | Once an hour, :00 |
@reboot | — | On system startup (Linux cron only) |
Jenkins H Modifier
Jenkins cron adds the H (hash) modifier. H is deterministic, not random — it computes a fixed offset from the job name hash, so the same job always runs at the same minute. This spreads load across the cluster without multiple jobs competing at :00.
| Expression | Meaning |
|---|---|
H * * * * | Once per hour at a fixed minute (e.g. always :17 for this job) |
H 9 * * 1-5 | Weekdays at some minute in the 9 o'clock hour (load-spread) |
H/15 * * * * | Every 15 min from a hashed starting offset |
H(0-29) * * * * | Every hour in the first 30 minutes |
TZ=America/New_York H 9 * * 1-5 | TZ= prefix overrides server timezone |
Jenkins defaults to server local time (not UTC). Use the TZ= prefix to override. @-aliases (@daily, @weekly, etc.) are also supported.
30-Second Common Patterns
| Expression | Meaning |
|---|---|
* * * * * | Every minute |
*/5 * * * * | Every 5 minutes |
0 * * * * | Every hour at :00 |
0 9 * * * | Daily at 9:00 AM |
0 9 * * 1-5 | Weekdays at 9:00 AM |
0 0 * * 0 | Sundays at midnight |
0 0 1 * * | 1st of every month at midnight |
0 0 1 1 * | January 1st at midnight |
0 2 * * * | Daily at 2:00 AM (common for backups) |
0 9-17 * * 1-5 | Every hour during business hours (weekdays) |
Frequently Asked Questions
What is the cron syntax for the last day of the month?
In standard Unix cron there is no built-in "last day" syntax. Use
28-31 and handle shorter months in your script, or switch to Quartz cron which supports L in the day-of-month field.Can I use month names like JAN or weekday names like MON in cron?
Yes. Most cron implementations accept 3-letter abbreviations:
JAN–DEC for months and SUN–SAT for weekdays. For example 0 0 1 JAN,JUL * fires on Jan 1 and Jul 1.What is the difference between <code>0 0 * * 0</code> and <code>@weekly</code>?
They are equivalent.
@weekly is a shorthand alias that expands to 0 0 * * 0 — midnight on Sunday. Aliases like @daily, @hourly, and @monthly work the same way.