Small Tools

Scheduling · Developer Guide

How Cron Expressions Work

Before deploying a scheduled job, check both the expression and the scheduler that executes it. A valid expression alone does not establish its timezone, daylight-saving behavior, or overlap policy.

What is a five-field cron expression?

The fields are minute, hour, day of month, month, and day of week. Small Tools uses numeric five-field syntax. It is not a Quartz parser and does not accept a leading seconds field, named weekdays, or macros such as @daily.

How to read a schedule

The parser lists each field and checks numeric bounds. The generator provides presets; select a preset and copy its expression into the scheduler configuration. It does not create a running job.

Weekdays at 09:00 in the scheduler's configured timezone
0 9 * * 1-5
│ │ │ │ └─ day of week
│ │ │ └─── month
│ │ └───── day of month
│ └─────── hour
└───────── minute

Example: periodic maintenance

Use */15 * * * * for minutes 0, 15, 30, and 45 of each hour. A step is evaluated within its field; */15 does not mean fifteen minutes after the previous execution finishes.

For a weekday report, use 0 9 * * 1-5 and configure the execution timezone explicitly in your scheduler. Test around a daylight-saving change if your selected zone observes one.

Common mistakes

  • Adding seconds to a five-field scheduler: 0 */5 * * * * has six fields and is rejected by this parser.
  • Confusing month and day-of-month positions: 0 0 1 * * is the first day of every month.
  • Restricting both day fields without checking semantics: traditional cron can match either restricted day-of-month or day-of-week; other schedulers differ.
  • Assuming a schedule prevents overlapping runs: long jobs need a lock, queue, or scheduler concurrency policy.

Practical deployment checklist

  • Check the target scheduler's accepted syntax and timezone setting.
  • Inspect several upcoming execution times in that scheduler, including month boundaries and daylight-saving transitions.
  • Make the job safe to retry and define how missed or overlapping runs are handled.
  • Alert on job failures and missing expected runs, rather than assuming the expression guarantees completion.

Limits and privacy

The local parser explains fields; it does not compute upcoming executions or validate a particular hosted scheduler's behavior. Schedule input stays in your browser. Avoid including production command lines or credentials when a bare expression is enough.

Run it yourself

These results come from the Small Tools tools rather than a scheduler. Cron Expression Parser lists the fields of 0 9 * * 1-5 as Minute: 0, Hour: 9, Day of month: every value, Month: every value and Day of week: 1 through 5. It reports */15 * * * * as Minute: every 15 values.

It rejects 0 */5 * * * * with Enter exactly five cron fields, 60 * * * * with Minute: value must be between 0 and 59, 0 9 * * MON with Day of week: value must be between 0 and 7, @daily as not five fields, and */0 * * * * with Minute: use a positive numeric step. It accepts 0 0 31 2 *, a date that never occurs, because it checks field ranges and not the calendar. The generator presets are everyMinute (* * * * *), everyFiveMinutes (*/5 * * * *), hourly (0 * * * *), daily (0 0 * * *), weekdays (0 9 * * 1-5), weekly (0 0 * * 0) and monthly (0 0 1 * *).

Cron Expression Parser results
0 9 * * 1-5
Minute: 0
Hour: 9
Day of month: every value
Month: every value
Day of week: 1 through 5

*/15 * * * *
Minute: every 15 values
(other fields: every value)

0 */5 * * * *      -> Enter exactly five cron fields: minute hour day-of-month month day-of-week.
60 * * * *         -> Minute: value must be between 0 and 59.
0 9 * * MON        -> Day of week: value must be between 0 and 7.
*/0 * * * *        -> Minute: use a positive numeric step.
0 0 31 2 *         -> accepted (February 31 never occurs)

What this guide does not verify

  • When a schedule actually runs. The parser does not compute upcoming executions, so check them in the scheduler you deploy to.
  • Other dialects: Quartz and similar schedulers add a seconds field, and some accept names or macros that this parser rejects.
  • Daylight-saving transitions. A job can be skipped or run twice around a clock change, depending on the scheduler.
  • Overlap, retry and missed-run policy, which belong to the scheduler rather than the expression.

Frequently asked questions

Does 0 9 * * 1-5 say anything about the timezone? No. The expression has no timezone. The crontab(5) manual describes a CRON_TZ variable for cron tables, and Kubernetes CronJobs have their own time zone setting, so check where your scheduler reads it.

What happens when both day fields are restricted? In traditional cron, 30 4 1,15 * 5 runs at 4:30 on the 1st and 15th and also every Friday, because a command runs when either day field matches. Other schedulers can differ, so check the documentation of yours.

Can a step apply to a range? Yes. The crontab(5) manual gives 0-23/2 as every other hour, and the parser accepts 1-10/2. Its output shows such a field as written rather than expanding it.

Related tools

References

Browse all developer guides →