Fifteen schedules you'll actually need
| # | Expression | Meaning |
|---|---|---|
| 1 | * * * * * |
Every minute |
| 2 | */5 * * * * |
Every 5 minutes |
| 3 | */30 * * * * |
Every 30 minutes |
| 4 | 0 * * * * |
Every hour, at minute 0 |
| 5 | 0 */2 * * * |
Every 2 hours |
| 6 | 0 0 * * * |
Every day at midnight |
| 7 | 0 6 * * * |
Every day at 6 AM |
| 8 | 30 23 * * * |
Every day at 11:30 PM |
| 9 | 0 9 * * 1-5 |
Every weekday at 9 AM |
| 10 | 0 0 * * 0 |
Every Sunday at midnight |
| 11 | 0 9 * * 6,0 |
Every weekend at 9 AM |
| 12 | 0 0 1 * * |
1st of every month at midnight |
| 13 | 0 0 1 1 * |
Once a year, January 1st |
| 14 | 0 9,17 * * * |
Twice daily: 9 AM and 5 PM |
| 15 | 59 23 28-31 * * |
Near month-end, checked daily from the 28th (approximate "last day" pattern) |
Why #15 needs an approximation
Cron has no native "last day of the month" concept — months have variable lengths (28–31 days), and cron fields don't support relative expressions like "L" (that's a Quartz-specific extension, not standard POSIX cron). The common workaround is scheduling a check every day from the 28th onward (28-31) and having the job itself verify it's actually the last day before running its real logic — the cron layer can't express that condition alone.
Combining list and range for irregular schedules
0 8-10,14-16 * * 1-5 runs at the top of every hour from 8–10 AM and 2–4 PM, weekdays only — combining two ranges via a list. This kind of nested combination is where hand-verifying against a descriptor tool pays off, since it's easy to misread which hours are actually included.
Common mistakes
- Forgetting
*/Ndoesn't mean "N times."*/5in the hour field means every 5th hour starting at 0 (0, 5, 10, 15, 20), not "5 times a day" — for evenly-spaced daily runs, verify the actual times produced. - Assuming day-of-month and day-of-week combine as AND. Most cron implementations OR them when both are restricted — see the Complete Guide to Cron Expressions for the full explanation.
- Not accounting for server timezone. All of the above run in whatever timezone the executing system's clock uses — confirm before assuming "9 AM" means your local 9 AM.
FAQ
Is there a cron pattern for "the last day of the month"?
Not directly in standard cron — schedule a daily check across the 28th–31st and have the job verify the date itself, or use a scheduler extension (like Quartz's L) that supports it natively.
How do I run something twice a day at specific times?
List both hours with a comma: 0 9,17 * * * runs at 9 AM and 5 PM.
What does 0 */2 * * * actually run at?
Midnight, 2 AM, 4 AM, 6 AM, and so on — every even hour, at minute 0.
Verify any of these patterns (or your own) instantly with the Cron Expression Descriptor.