Cron Expression Generator
Switch between Quartz 6-field and Unix 5-field modes, quickly build deployable cron expressions, and preview upcoming execution times.
0 */5 * * * ?Raw Expression
Paste an existing cron expression to load it back into the builder.
Schedule Builder
Edit fields directly if you know the syntax, or start from a preset.
Syntax Overview
The patterns below cover the majority of production cron scenarios.
*/5e.g., */5 means execute every 5 units. Commonly used for every-N-minutes schedules.
1-5e.g., 1-5 represents a continuous interval. Useful for weekday or month ranges.
MON,WED,FRIe.g., MON,WED,FRI matches multiple discrete values.
?Quartz uses ? to indicate a field that should not participate in matching, avoiding day-vs-week conflicts.
Natural Language Interpretation
Runs every 5 minutes
Quartz mode is for schedulers with a seconds field, such as Spring / Quartz. If you deploy to Linux or Kubernetes, switch to Unix mode first and re-verify the expression.
Next 5 Execution Times
Field Reference
0-59Controls the seconds value within a minute. Quartz mode only.
0-59Controls the minutes value within an hour.
0-23Controls the hour value in 24-hour format.
1-31Controls the day of the month. In Quartz, often paired with ? in the week field.
1-12 or JAN-DECControls the month. Accepts numeric values or month abbreviations.
0-7 or SUN-SATControls the day of the week. Accepts numeric values or day abbreviations.
Special Characters
*Matches all possible values for that field.
*/nRepeats at a fixed interval, e.g., every 5 minutes.
a-bMatches all continuous values between the start and end boundaries.
a,b,cMatches multiple explicit values within the same field.
?Quartz-only. A placeholder indicating that the field does not participate in schedule matching.
Common Schedule Templates
Start from real-world scenarios rather than six blank fields.
What problem does this Cron page solve?
Cron syntax is short, but the cost of getting it wrong is high. A single misplaced field can silently change "every 5 minutes" to "once a month." This page is designed to shorten the debugging loop: build the expression and immediately see the final result and predicted execution times.
The page supports both Unix 5-field and Quartz 6-field modes, so it works for Linux servers, Kubernetes CronJobs, and Spring / Quartz schedulers that require a seconds field.
How to use this tool
First, choose the cron mode that matches your target platform, then either start from a preset or edit each field directly. The expression updates immediately. If you already have a cron string, paste it into the "Raw Expression" area to load it back into the builder for inspection.
Before deploying, always read the natural-language interpretation and verify that the next 5 execution times match your expectations. This step is the most effective way to catch field-order errors, day-of-week misunderstandings, and platform mode mismatches.
Pre-Deployment Notes
- Cron trigger times always depend on the timezone of the scheduler host. Verify the server timezone before deployment. In Kubernetes CronJobs, the default is UTC — use spec.timeZone to set it explicitly.
- Unix cron and Quartz cron are not interchangeable by default. Confirm whether the target platform expects 5 or 6 fields. Using the wrong mode will cause jobs to either not run or run at unexpected frequencies.
- In Quartz, the day-of-month and day-of-week fields are often paired with ? to prevent both fields from constraining the schedule simultaneously. Unix cron does not support ? — if either field matches, the job triggers.
- This page covers the most common cron syntax. If your platform supports specialized extensions (such as @yearly, L, W, etc.), we recommend a final test in the target environment.
- When writing cron expressions in shell scripts or YAML, be mindful of special characters like * and /. In Kubernetes CronJob YAML, wrap the expression in quotes to prevent the YAML parser from misinterpreting them.
- When deploying a new cron job for the first time, start with "every minute" as a temporary test to confirm the job itself runs correctly, then switch to your actual desired schedule.
Typical Production Scenarios
The following are the most common scheduling patterns in DevOps practice. Use the expressions as a direct reference or adapt them to your specific needs.
Quartz: 0 0 2 * * ?Unix: 0 2 * * *Trigger a full build or integration test run during off-peak hours (typically 2 AM) to avoid competing for CI runner capacity during the day. If the build is long-running, set a job-level timeout to prevent a hung build from blocking subsequent runs and exhausting your CI queue.
Quartz: 0 30 1 * * ?Unix: 30 1 * * *Run a full backup at 1:30 AM, ensuring it completes and its integrity is verified before the morning traffic peak. Combine with --single-transaction (MySQL) or pg_dump for a consistent snapshot. Always emit a confirmation log or alert — never rely on the script running without verifying the result.
Quartz: 0 0 3 * * ?Unix: 0 3 * * *Let's Encrypt certificates expire after 90 days; certbot only performs renewal when fewer than 30 days remain. Running daily at 3 AM is safe — most runs are no-ops, and the actual renewal only triggers near expiry. After a successful renewal, reload or restart your web server (e.g. nginx -s reload) to apply the new certificate immediately.
Quartz: 0 5 0 * * ?Unix: 5 0 * * *Scheduling at 00:05 instead of 00:00 avoids resource contention with other top-of-hour jobs and gives the system a 5-minute buffer to finish writing the previous day's logs before rotation begins. In practice, this is commonly paired with the logrotate utility — logrotate handles the file splitting, cron handles the scheduling.
Quartz: 0 50 7 * * 1-5Unix: 50 7 * * 1-5For workloads that spike at 8 AM on weekdays (e.g., B2B SaaS platforms, internal enterprise tools), triggering a cache warm-up script at 07:50 — 10 minutes early — can significantly reduce cache miss rates and peak database load during the morning rush. Limiting to weekdays (1-5) avoids unnecessary resource consumption on weekends.
Quartz: 0 */5 * * * ?Unix: */5 * * * *Sending an HTTP probe or TCP check to critical services every 5 minutes is the most fundamental availability monitoring approach. A self-hosted health-check script can run entirely within a private network without any public internet dependency — ideal for air-gapped or private-cloud deployments. Ensure your alerting pipeline includes deduplication to avoid flooding on-call with repeated alerts from transient blips.
Common Cron Expression Examples (Cheat Sheet)
Here are the most frequently searched cron expression patterns (all in Unix 5-field format). Copy them directly, or paste them into the builder above to see the plain-English explanation and the next run times.
*/5 * * * **/5 makes the minute field fire every 5 units — the most common frequency for health checks, probes, and lightweight polling. Change it to */10 or */15 for every 10 or 15 minutes.
0 * * * *Minute 0 and hour * fires once at the top of every hour, commonly used for hourly aggregation and cache refresh. Every 2 hours is 0 */2 * * *.
0 0 * * *0 0 fires daily at 00:00, ideal for day-grained batch jobs. Equivalent to crontab's @daily.
0 2 * * *The classic off-peak time for full backups and nightly builds, avoiding daytime peak resource usage.
0 9 * * 1-5The weekday field 1-5 means Monday through Friday, skipping weekends. Great for workday reports and pre-shift cache warm-up.
0 8 * * 1The weekday field 1 means Monday (both 0 and 7 mean Sunday). Commonly used for weekly reports and weekly cleanup tasks.
0 0 1 * *The day field 1 fires at 00:00 on the first day of each month — ideal for monthly billing and start-of-month archiving. Equivalent to @monthly.
0 0 * * 0The weekday field 0 means Sunday, commonly used for weekly full backups and weekend maintenance-window tasks.
Timezone Pitfalls Explained
Cron has no built-in concept of timezones — trigger times are determined entirely by the system clock of the machine running the scheduler. This is one of the most common root causes of silent scheduling bugs in containerized and multi-region deployments: you write "8 AM," the server interprets it as "UTC 8 AM," and the actual trigger time ends up being 4 PM in your local timezone.
Docker containers inherit the host's timezone by default, but most cloud instances (AWS EC2, GCP Compute Engine, Alibaba Cloud ECS) ship configured to UTC, not your local timezone. Before deploying, confirm the current system time with date and inspect the full timezone configuration with timedatectl — both checks are necessary.
Kubernetes versions prior to v1.27 forced all CronJobs to use UTC with no timezone option. v1.27+ officially introduced the spec.timeZone field, which accepts standard IANA timezone identifiers such as Asia/Shanghai or America/New_York. If your cluster predates v1.27, the only workaround is manually offsetting the expression for the UTC difference — and documenting that offset in comments so future maintainers don't silently revert it.
Daylight Saving Time (DST) introduces another class of subtle bugs: when clocks spring forward, any time between 2:00 AM and 3:00 AM simply does not exist on that day — cron jobs scheduled in that window will be silently skipped. When clocks fall back, the window repeats and jobs may fire twice. For production-critical tasks, schedule them before 1:00 AM or after 3:30 AM to avoid the DST ambiguity zone entirely.