Developer

Cron Expressions: Scheduling Without Guesswork

Learn how cron fields work, how flavors differ, and how to build schedules you can explain to your future self.

July 29, 20266 min readDeveloperAll Learning Center →

Overview

Cron expressions describe recurring schedules as a compact string of fields: minute, hour, day of month, month, and day of week—sometimes with seconds or years depending on the scheduler. One character out of place can mean “every minute” instead of “once a day.”

The hard part is not memorizing asterisks; it is knowing which cron dialect your platform uses. Unix cron, cron libraries in languages, Kubernetes CronJobs, and cloud schedulers disagree on field count, day-of-week numbering, and whether both day-of-month and day-of-week must match.

Build and sanity-check schedules with Dockzio’s Cron Expression Builder so you can see human-readable meaning before you paste the string into production.

Step-by-step

  1. 1. Learn the standard five-field shape

    Classic cron is `minute hour day-of-month month day-of-week`. `0 9 * * 1-5` means 09:00 on weekdays in many Unix systems. `*` means “every,” ranges use `-`, lists use commas, and steps use `/` (for example `*/15` for every 15 minutes).

    Write the intent in English first, then translate to fields. That habit reduces off-by-one hour mistakes.

  2. 2. Confirm your platform’s dialect

    Some systems add a leading seconds field. Others add a years field. Day-of-week may be 0–6 or 1–7, and Sunday may be 0 or 7. Quartz-style cron is not Unix cron.

    Read the docs for the exact product you deploy to. A valid string in one engine can be rejected—or worse, reinterpreted—in another.

  3. 3. Be careful with day-of-month vs day-of-week

    In traditional cron, specifying both day-of-month and day-of-week often means “either matches,” not “both.” That surprise causes jobs to run more often than intended.

    When you need “the 15th if it is a Monday,” check whether your scheduler supports special syntax or handle the rule in application code.

  4. 4. Think in time zones explicitly

    Cron usually evaluates in the host’s local time or a configured zone. Containers and serverless platforms may default to UTC. Decide the zone for “9 AM business days” and document it next to the expression.

    DST transitions can skip or repeat an hour. Avoid one-shot critical jobs exactly at ambiguous local times when possible.

  5. 5. Build, read back, then deploy

    Use the Cron Expression Builder to assemble fields and read the plain-language summary. Cross-check a few next-run times mentally (or with your platform’s preview if it has one).

    Store the expression in config with a comment stating intent and time zone. Future you will thank present you.

Common mistakes

  • Forgetting which field is which. Swapping minute and hour is common when rushing. `9 * * * *` is every minute during hour 9, not 9:00 once.
  • Assuming Monday is always day 1. Numbering and first-day-of-week conventions differ. Prefer day names (`MON`) when your dialect supports them.
  • Ignoring time zones. A job set for 09:00 UTC is 4 or 5 AM Eastern depending on DST. Align the zone with the business meaning of the schedule.
  • Running heavy jobs every minute by accident. `* * * * *` is a load test, not a heartbeat, on many systems. Start from an explicit minute value and widen carefully.

FAQ

Quick answers to common questions.

In most dialects it means every 5 minutes (0, 5, 10, …). Confirm step semantics in your scheduler if you use unusual ranges.

Practice the concepts from this guide with free browser tools — files stay on your device.

Browse categories:Developer ToolsMore in Developer

Suggested next reading

Newsletter

Production intelligence in your inbox

Get practical guides on PDF/X, color, press profiles, and production workflows — written for commercial print teams.

Professional updates only. No popups, no clutter.