Cron Expression Examples: 30 Schedules Explained (with Pitfalls)
Learn cron syntax field by field and copy 30 tested cron expressions for every N minutes, weekdays, monthly jobs, business hours and more, plus time zone pitfalls.
· 6 min read
Cron has scheduled recurring jobs on Unix systems since the 1970s, and its five-field syntax now drives Kubernetes CronJobs, GitHub Actions, cloud schedulers such as AWS EventBridge and Google Cloud Scheduler, CI pipelines and countless job libraries. The syntax is compact enough to memorise, but subtle enough that most engineers have shipped at least one schedule that ran at the wrong time. This guide explains each field, then lists 30 practical expressions with notes on the traps.
The five fields
┌───────────── minute (0–59)
│ ┌─────────── hour (0–23)
│ │ ┌───────── day of month (1–31)
│ │ │ ┌─────── month (1–12 or JAN–DEC)
│ │ │ │ ┌───── day of week (0–6 or SUN–SAT; 7 is also Sunday on most systems)
│ │ │ │ │
* * * * *
Each field accepts:
*— every value.- A number —
5means exactly 5. - A list —
1,15means 1 and 15. - A range —
9-17means 9 through 17 inclusive. - A step —
*/15means every 15th value starting from the minimum;10-50/20means 10, 30, 50.
A job runs when the current time matches all fields — with one important exception covered below. Paste any expression into a cron expression parser to see a plain-language description and the next run times.
Every N minutes or hours
* * * * *— every minute.*/5 * * * *— every 5 minutes (at :00, :05, :10 ...).*/15 * * * *— every 15 minutes.0,30 * * * *— every half hour, on the hour and half past.7 * * * *— every hour at 7 minutes past. Choosing an odd minute spreads load away from the busy top of the hour.0 */2 * * *— every 2 hours, at 00:00, 02:00, 04:00 ...0 */6 * * *— four times a day: 00:00, 06:00, 12:00, 18:00.15 8-18/2 * * *— at 08:15, 10:15, 12:15, 14:15, 16:15 and 18:15.
Pitfall: steps restart at every boundary. */7 in the minute field fires at :00, :07 ... :56 and then :00 again, so the gap across the hour is 4 minutes, not 7. If you need a true fixed interval that does not divide 60, use a scheduler that supports intervals or have the job check elapsed time itself.
Daily schedules
0 0 * * *— every day at midnight.30 2 * * *— every day at 02:30, a classic backup window.0 9,17 * * *— at 09:00 and 17:00 daily.0 12 * * *— at noon.45 23 * * *— at 23:45, just before midnight for end-of-day reports.
Pitfall: jobs between 01:00 and 03:00 local time can be skipped or run twice on daylight saving transitions. If your server uses a zone with DST, schedule critical jobs outside that window or run the server in UTC.
Weekdays and weekends
0 9 * * 1-5— 09:00 Monday to Friday.*/10 9-17 * * 1-5— every 10 minutes during business hours on weekdays (last run at 17:50).0 10 * * 6,0— 10:00 on Saturday and Sunday.0 8 * * MON— 08:00 every Monday. Names are case-insensitive on most implementations.30 16 * * 5— Friday at 16:30.
Monthly and yearly
0 0 1 * *— midnight on the first day of every month.0 6 15 * *— 06:00 on the 15th of each month.0 0 1,15 * *— on the 1st and 15th, common for payroll.0 0 1 1 *— midnight on 1 January.0 9 1 */3 *— 09:00 on the first day of every quarter (January, April, July, October).0 0 L * *— the last day of the month. Note:Lis an extension supported by Quartz, some cloud schedulers and a few libraries, but not by classic Unix cron.0 22 28-31 * *combined with a check inside the script ([ "$(date -d tomorrow +%d)" = "01" ]) — a portable way to run on the last day of the month with standard cron.
Day of month or day of week?
0 9 13 * 5— many people read this as "Friday the 13th". In classic cron it means every 13th of the month and every Friday. When both day fields are restricted (neither is*), Vixie cron and its descendants run the job when either matches.
To run only on Friday the 13th, schedule 0 9 13 * * and check the weekday in the script, or use a scheduler with explicit AND semantics. This is the most surprising rule in cron and worth remembering.
Special strings
Many cron implementations accept shortcuts:
@hourly— same as0 * * * *.@dailyor@midnight—0 0 * * *.@weekly—0 0 * * 0.@reboot— once at startup (Unix cron only; not available in Kubernetes or GitHub Actions).
Platform differences
- Kubernetes CronJobs use standard five-field syntax. Since Kubernetes 1.27 you can set
spec.timeZone: "Europe/Berlin"; otherwise schedules follow the controller manager's zone, which is usually UTC. - GitHub Actions schedules always run in UTC, can be delayed during periods of high load, and the minimum interval is 5 minutes. Avoid
0 * * * *if precision matters; choose an odd minute. - AWS EventBridge uses six fields (
minute hour day-of-month month day-of-week year) and requires?in one of the two day fields. - Quartz (Java) and Spring use six or seven fields with seconds first:
0 0 9 * * MON-FRI. - systemd timers use a different, more readable syntax (
OnCalendar=Mon..Fri 09:00) and handle missed runs withPersistent=true.
Always confirm which dialect your platform expects before copying an expression.
Time zones
Cron evaluates expressions in the scheduler's time zone. A job written as 0 9 * * * by a developer in Tokyo runs at 09:00 UTC on a UTC server — 18:00 in Tokyo. Recommendations:
- Run servers and schedulers in UTC, and convert intended local times to UTC when writing schedules.
- If a job must follow local business hours across DST changes, use a scheduler that supports explicit time zones.
- Log the timestamp of each run in UTC — see the Unix timestamp guide for why.
Making jobs robust
Correct timing is only half the battle:
- Prevent overlaps. If a job can run longer than its interval, use a lock (
flockon Unix,concurrencyPolicy: Forbidin Kubernetes). - Make jobs idempotent. A job that runs twice, for example after a retry or DST overlap, should not double-charge customers.
- Capture output. Classic cron emails output to the local user, which usually goes nowhere. Redirect to logs and alert on failures.
- Use absolute paths. Cron runs with a minimal environment and
PATH; scripts that work in your shell often fail under cron. - Monitor for silence. A heartbeat service that alerts when a job did not check in catches broken schedules that would otherwise fail silently.
Summary
Cron's five fields — minute, hour, day of month, month, day of week — combined with lists, ranges and steps cover nearly every recurring schedule. Watch for the OR rule when both day fields are set, steps that reset at boundaries, DST around 01:00–03:00, and platform dialects with extra fields. Verify every expression with a parser that shows upcoming runs before you deploy it.