Cron Expression Examples Explained

Reference tables of cron expressions are everywhere on the web. The problem is that they rarely tell you when to use a particular schedule, why it's structured the way it is, or what can go wrong. This guide walks through the most common cron patterns I have used and reviewed in production over the past decade, with the context that turns each expression from a copy-paste snippet into a deliberate scheduling decision.

All examples use the standard 5-field Unix cron format (minute, hour, day-of-month, month, day-of-week), which is what Linux crontab, Kubernetes CronJobs, and GitHub Actions accept. If you are working with Java Quartz or Spring Boot, see the Quartz cron guide for the 6-7 field variant.

Short-Interval Polling Schedules

Short intervals are useful when you need to react quickly to external state changes — health checks, queue draining, cache refreshes, or webhook retries. The trade-off is load: a job that runs every minute generates 1,440 invocations per day, so even small per-run costs add up.

ExpressionDescription
* * * * *Every minute
*/5 * * * *Every 5 minutes
*/10 * * * *Every 10 minutes
*/15 * * * *Every 15 minutes
*/30 * * * *Every 30 minutes

A common mistake with short intervals is forgetting that all minute marks fire at the same wall-clock instant across every host. If you have ten replicas of a CronJob, all ten will start at exactly :00 of each minute, often hammering the same downstream service. For high-frequency polling, prefer a queue worker, an event-driven trigger, or jitter the schedule with sleep at the start of the script.

Daily Maintenance Schedules

Most production cron jobs run once a day during off-peak hours. The exact time matters more than people realize: in a global SaaS, "midnight" in your timezone might be peak traffic in another region. A reliable rule of thumb is to schedule maintenance jobs during your application's lowest-traffic window, not during your team's sleeping hours.

ExpressionDescription
0 0 * * *Every day at midnight (server timezone)
0 2 * * *Every day at 2:00 AM (typical backup window)
0 6 * * *Every day at 6:00 AM (morning batch ready)
0 12 * * *Every day at noon
0 9,18 * * *Twice daily — 9:00 AM and 6:00 PM

Daily backups are the canonical example. 0 2 * * * at 2:00 AM is popular because it sits after most US/EU traffic dies down but before European workers start. On Kubernetes, double-check your .spec.timeZone value (introduced in 1.27) — without it, jobs run in the kube-controller-manager timezone, which is almost always UTC. A schedule of 0 2 * * * in UTC is 6:00 AM Istanbul time, which is far from off-peak.

Business-Hours Schedules

Business-hours schedules combine the day-of-week and hour fields. The pattern * * * * 1-5 means "Monday through Friday" (the 1-5 range maps to Mon-Fri in standard Unix cron). Use these for jobs that should only operate during office hours: email digests, internal reports, on-call notifications, or anything that would be wasted CPU on a weekend.

ExpressionDescription
0 9 * * 1-5Weekdays at 9:00 AM (morning standup digest)
0 17 * * 1-5Weekdays at 5:00 PM (end-of-day summary)
0 9-17 * * 1-5Hourly during business hours, weekdays only
*/30 9-17 * * 1-5Every 30 minutes between 9 AM and 5 PM, weekdays

A subtle gotcha: 0 9-17 * * 1-5 fires at 9:00, 10:00, …, 17:00. That includes 5:00 PM on the dot, which might be after your team has logged off. To stop at 4:00 PM, use the upper bound 9-16. Cron ranges are inclusive on both ends, which catches everyone off guard the first time.

Weekly & Monthly Rotations

Weekly and monthly schedules are great for heavier work that doesn't need to run daily — full database backups, log archives, certificate renewals, or report generation. Be careful with 0 0 1 * * (first of every month): it will not fire on February 29 if you change it to 0 0 29 * *, and it will silently skip months that don't have a 31st if you use 0 0 31 * *.

ExpressionDescription
0 0 * * 0Every Sunday at midnight
0 3 * * 0Sunday at 3:00 AM (weekly maintenance window)
0 0 * * 6,0Weekends at midnight
0 0 1 * *First of every month at midnight
0 0 15 * *15th of every month at midnight (mid-month billing)
0 0 1 */3 *First day of every quarter
0 0 1 1 *January 1st at midnight (annual reset)

The Unix cron interpretation of day-of-month and day-of-week is unusual: when both are set to specific values (anything other than *), the schedule fires when either matches, not both. So 0 0 13 * 5 fires on the 13th of every month and every Friday — usually not what people expect when reading "Friday the 13th". To require both, you need Quartz with the ? wildcard or post-process in your script.

DevOps & Site Reliability Schedules

The patterns below come up constantly in DevOps work — health checks, log rotation, certificate monitoring, deployment freezes, and so on. They are simple expressions but carry a lot of operational weight. A misfired backup or a stuck health check can cascade into real outages.

ExpressionUse case
*/5 * * * *External health check / uptime probe
0 2 * * *Nightly database backup (off-peak)
0 3 * * 0Weekly full backup & archive rotation
0 0 1 * *Monthly log compaction & cleanup
0 0 * * 1Weekly metric snapshot for capacity planning

Always pair production cron jobs with monitoring. A schedule firing successfully is not the same as a job completing successfully. Consider a dead-man's switch (Healthchecks.io, Cronitor, or a simple metric increment) so that you get paged when a job fails to run, not just when it errors. For a deeper dive into running cron jobs in production, see our cron best practices guide and troubleshooting reference.

Frequently Asked Questions

What does */5 * * * * mean in cron?

The expression */5 * * * * means "every 5 minutes". The /5 is a step value applied to the minute field. The schedule fires at minutes 0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, and 55 of every hour, regardless of the day, month, or weekday.

How do I run a cron job every hour at a specific minute?

Use the form M * * * * where M is the minute. For example, 15 * * * * runs at 00:15, 01:15, 02:15, and so on. Use 0 * * * * for the top of every hour.

How do I schedule a cron job for weekdays only?

Use 1-5 in the day-of-week field (the 5th field). For example, 0 9 * * 1-5 runs the job at 09:00 Monday through Friday. In Unix cron, 1 = Monday and 5 = Friday. In Quartz, weekday numbers shift by one (Sunday = 1).

How do I run a cron job on the first day of every month?

Use 0 0 1 * * to run at midnight on the 1st of every month. Note that this fires whether the 1st is a weekday or weekend. If you specifically need a weekday, use systemd timers or Quartz with the W modifier.

Why would I prefer */15 over 0,15,30,45?

Both expressions produce the same schedule, but */15 is shorter, easier to read, and signals intent more clearly: "every 15 minutes from the start of the hour". For irregular intervals (for example minute 7 and minute 23), the comma form is the only option.