Cron Syntax Explained: 25 Real Schedules and Common Mistakes

Reviewed September 3, 2026 · Maintained by William

A traditional five-field cron expression is read as minute, hour, day of month, month, day of week. That simple order is easy to remember; the mistakes usually come from ranges, steps, dialect differences and time zones.

# min hour day month weekday
  *   *    *   *     *

25 practical schedules

ExpressionMeaning
* * * * *Every minute
*/5 * * * *Every 5 minutes
0 * * * *At minute 0 of every hour
30 * * * *At minute 30 of every hour
0 0 * * *Daily at 00:00
0 9 * * *Daily at 09:00
15 9 * * *Daily at 09:15
0 9,17 * * *Daily at 09:00 and 17:00
0 9-17 * * *Hourly from 09:00 through 17:00
*/15 9-17 * * *Every 15 minutes during those hours
0 9 * * 1Monday at 09:00
0 9 * * 1-5Weekdays at 09:00
0 10 * * 6,0Weekend at 10:00 in common 0/7-Sunday cron
0 0 1 * *First day of each month
0 0 15 * *15th of each month
0 0 1 1 *January 1 at midnight
0 6 1 */3 *06:00 on day 1 every third month in implementations supporting that step
0 2 * * 0Sunday at 02:00
5 0 * * *Daily at 00:05
0 */6 * * *Every six hours
10,40 * * * *Minute 10 and 40 of every hour
0 8-18/2 * * 1-5Every two hours in the range, weekdays
0 23 * * *Daily at 23:00
59 23 * * *Daily at 23:59
0 12 1-7 * 1Potential “first Monday” pattern only if your cron’s DOM/DOW semantics match your intention; verify before use

Common mistakes

  • Writing 60 in the minute field; minutes normally run 0–59.
  • Assuming every cron supports seconds. Traditional Unix cron usually starts with minutes; Quartz often uses an extra seconds field.
  • Forgetting that the scheduler’s time zone controls when the expression fires.
  • Misunderstanding how day-of-month and day-of-week interact in the chosen implementation.

The Cron Expression Humanizer helps explain supported expressions, and the Cron Next Run Calculator helps inspect upcoming matches. Always compare with the scheduler you deploy.

Reference

crontab(5) — Linux man-pages

Twenty-five five-field cron examples

ExpressionTypical meaning
0 9 * * *09:00 every day
30 9 * * *09:30 every day
0 */6 * * *Every 6 hours at minute 0
*/15 * * * *Every 15 minutes
0 0 * * 0Midnight on Sunday
0 8 * * 1-508:00 Monday–Friday
0 18 * * 1-518:00 Monday–Friday
0 9 * * 109:00 every Monday
0 9 1 * *09:00 on day 1 of each month
0 9 1 1 *09:00 on January 1
5 0 * * *00:05 every day
0 2 * * *02:00 every day
0 2 * * 602:00 every Saturday
0 12 15 * *12:00 on day 15
0 0 1 */3 *Midnight on day 1 every third month in implementations supporting that step
10,40 * * * *Minute 10 and 40 of every hour
0 9,13,17 * * *09:00, 13:00 and 17:00 daily
0 9-17 * * *Every hour from 09:00 through 17:00
*/5 9-17 * * 1-5Every 5 minutes during weekday working hours
45 23 * * *23:45 daily
0 4 1,15 * *04:00 on day 1 and 15
0 7 * 6-8 *07:00 during June–August
0 0 * * 1,3,5Midnight Monday, Wednesday, Friday
20 3 * * 003:20 Sunday
0 0 31 * *Midnight on the 31st only in months that have a 31st

The day-of-month/day-of-week trap

Traditional cron implementations can treat day-of-month and day-of-week in a way that surprises developers when both are restricted. Do not assume the expression means a simple logical AND across every field. Check the manual for the scheduler you actually use, especially if you are translating an expression into Quartz, Kubernetes, a cloud scheduler or a JavaScript library.

Environment is part of the schedule

The same five fields can run at different wall-clock times if one server uses UTC and another uses a local timezone. Cron also runs with a different environment from your interactive shell: PATH, working directory, credentials and loaded shell profile can differ. Use absolute paths and explicit environment configuration for production jobs.

Failure-proof scheduled jobs

  • Make jobs idempotent where possible so a retry does not duplicate side effects.
  • Use locking for work that must not overlap.
  • Capture stdout/stderr or structured logs so failures are visible.
  • Set timeouts for network work.
  • Record the last successful run and alert on missed schedules when the task matters.
  • Document the scheduler timezone beside the expression.

The Cron Expression Humanizer is helpful for a first interpretation, and the Cron Next Run Calculator is useful for spot checks. Your scheduler’s own documentation remains the final authority.

About the review

This guide is maintained by William. Technical claims are checked against primary or authoritative references where applicable. See How We Test CodeNimbleTools for the site-wide review and correction process.