Cron Expression Explainer & Next Runs

Enter a standard 5-field cron expression (minute hour day month weekday) to see a human-readable summary and upcoming runs.

Next 8 Runs (Local Time)



            

Cron Expression Syntax & Guide

A standard Unix cron expression consists of five space-separated fields that define when a scheduled job runs: minute (0–59), hour (0–23), day of month (1–31), month (1–12), and day of week (0–6, where 0 is Sunday). This explainer parses your expression locally, translates it into plain English, and calculates the next upcoming execution timestamps in your browser.

Supported Cron Operators

  • Asterisk (*): Matches every possible value for that field. For example, * * * * * runs every single minute.
  • Step (*/n): Runs at regular intervals. For example, */15 * * * * runs at minutes 0, 15, 30, and 45 of every hour.
  • Range (a-b): Matches an inclusive range, such as 9-17 for business hours or 1-5 for Monday through Friday.
  • List (a,b,c): Matches specific discrete values, such as 0,30 for the top and bottom of the hour.

Common Real-World Schedules

  • */5 * * * * - Every 5 minutes (health checks, queue workers, cache warming).
  • 0 * * * * - At minute 0 of every hour (hourly metrics aggregation).
  • 0 3 * * * - Daily at 03:00 AM (database backups, log rotation).
  • 30 8 * * 1-5 - Weekdays at 08:30 AM (daily digest emails, standup reminders).
  • 0 0 1 * * - Monthly on the 1st at midnight (billing summaries, monthly reports).

Tips & Frequently Asked Questions

  • What timezone does cron use? System crontab uses the server's local timezone unless CRON_TZ=UTC is set. Cloud schedulers (GitHub Actions, Kubernetes CronJobs, AWS EventBridge) almost always evaluate expressions in UTC.
  • How do day-of-month and day-of-week interact? In standard Vixie cron, if both day-of-month and day-of-week are restricted (neither is *), the job runs when either condition matches. Always double-check the next run list above when combining both fields.
  • Why use */15 instead of 15? Writing 15 * * * * runs only once per hour at minute 15, whereas */15 * * * * runs four times per hour (00, 15, 30, 45).

Production Cron Best Practices

In production environments, always wrap long-running cron jobs with a lock utility such as flock -n /tmp/job.lock so overlapping executions do not pile up if a task takes longer than its interval. Redirect both standard output and standard error (>> /var/log/job.log 2>&1) or ship logs to a centralized collector, and explicitly set PATH at the top of your crontab because cron runs with a minimal non-interactive environment. For critical jobs like database backups or billing runs, monitor heartbeat pings (dead-man's switch) so silent failures or skipped runs during server reboots alert your team immediately. Finally, avoid scheduling heavy jobs at 0 0 * * * (midnight) if your infrastructure shares resources with other daily jobs - staggering start minutes (e.g., 17 2 * * *) prevents thundering-herd CPU and I/O spikes.

Please read the privacy policy (agreement of the cookies usage, other websites embedded content, etc.). If you continue to use the site, we will assume that you agree with our privacy policy.
OkPrivacy Policy