🎮 How to Use
- Type a cron expression:
minute hour day month weekday. - Plain English explanation appears below.
- Examples:
0 9 * * 1-5= 9am weekdays.
About this tool
Cron expressions schedule recurring tasks on Unix systems. 5 fields: minute (0-59), hour (0-23), day of month (1-31), month (1-12), day of week (0-6, Sun=0). Special: * = any, */n = every n, 1-5 = range, 1,3,5 = list.
What cron is and how a field is read
Cron is the time-based job scheduler built into Unix and Linux. A line in a crontab pairs a five-field time specification with a command, and the cron daemon checks every minute whether the current time matches; when it does, the command runs. The five fields, in order, are minute, hour, day of month, month, and day of week. The genius of the format is that each field is evaluated independently, and a job fires only when all five fields match the current moment at once.
Each field accepts more than a single number. A star means "every value", so a star in the hour field matches all 24 hours. A step like */15 means "every 15 units" starting from the lowest value, so */15 in the minute field fires at minutes 0, 15, 30, and 45. A range such as 1-5 in the day-of-week field means Monday through Friday, and a list like 8,20 in the hour field means exactly 8 AM and 8 PM. Combining these is what gives cron its range, from "once a year" to "every minute".
Cron expression cheat sheet
A cron expression is a 5-field schedule. Each field accepts a number, a list (comma-separated), a range (a-b), a step (* /n), or special wildcards.
| Field | Position | Allowed values | Special chars |
|---|---|---|---|
| Minute | 1st | 0-59 | * , - / |
| Hour | 2nd | 0-23 | * , - / |
| Day of month | 3rd | 1-31 | * , - / ? |
| Month | 4th | 1-12 or JAN-DEC | * , - / |
| Day of week | 5th | 0-6 or SUN-SAT (0=Sun) | * , - / ? |
Common cron patterns
| Schedule | Cron expression |
|---|---|
| Every minute | * * * * * |
| Every 5 minutes | */5 * * * * |
| Every hour on the hour | 0 * * * * |
| Every day at midnight UTC | 0 0 * * * |
| Every weekday at 9am | 0 9 * * 1-5 |
| Twice a day (8am, 8pm) | 0 8,20 * * * |
| First of the month at midnight | 0 0 1 * * |
| Every Sunday at 2:30am | 30 2 * * 0 |
| Last Friday of the month | 0 0 * * 5L (Quartz only - not in standard cron) |
| Every 15 min during business hours, Mon-Fri | */15 9-17 * * 1-5 |
Pitfalls
- Timezone - most cron daemons run in the server's local time. If the server is UTC, "every day at 9am" runs at 9am UTC. Specify the timezone in your scheduler (Kubernetes CronJob supports timeZone, GitHub Actions runs in UTC).
- Day of month AND day of week - if both are set (not *), standard cron runs when EITHER matches. Quartz runs when BOTH match. Test before depending.
- Step from non-zero start -
5/10 * * * *means start at minute 5, then every 10 minutes (5, 15, 25...). Many people expect it to mean "every 5 minutes after minute 10", which is wrong. - DST transitions - schedules at 2:00-3:00am in DST-observing timezones either skip (spring forward) or run twice (fall back). Avoid this window for critical jobs.
Cron vs alternatives
- systemd timers - more powerful (calendar events, persistence after sleep, dependencies). Standard on modern Linux.
- at - one-shot scheduling.
echo "task" | at 5pm tomorrow. - Kubernetes CronJob - cron syntax with cluster-level scheduling, retry policies, history.
- GitHub Actions / GitLab CI - same cron syntax for repository-level scheduled workflows. Runs in UTC.
- AWS EventBridge - cron + rate() expressions. Cron has 6 fields (adds year).
Why a plain-English explainer helps
Cron syntax is compact but unforgiving, and a misplaced field silently changes when a job runs. The classic trap is the difference between the day-of-month and day-of-week fields: 0 0 13 * 5 does not mean "Friday the 13th". In standard cron, when both the day-of-month and the day-of-week fields are restricted, the job runs when either one matches, so that expression fires on every 13th of the month and every Friday. Pasting the expression into an explainer catches this immediately, before you ship a job that emails customers far more often than intended. Reading an expression out loud, field by field, is also the fastest way to review a teammate's crontab in a code review without running it on a server first.
Worked example: reading 30 17 * * 1-5
Suppose you find this line in a colleague's crontab and want to know when it runs.
- Minute (30): at minute 30 of the hour.
- Hour (17): during the 17th hour, which is 5 PM.
- Day of month (*): any day of the month.
- Month (*): any month.
- Day of week (1-5): Monday through Friday (1 is Monday, 5 is Friday).
Related tools
Frequently asked questions
Does 0 0 * * 0 mean every Sunday or Saturday?
Sunday. Standard cron uses 0=Sunday, 6=Saturday. Some dialects accept 7 for Sunday for backward compatibility.
What timezone is my cron running in?
By default, the server's system timezone. Check with `date` or `timedatectl`. Cloud schedulers (GitHub Actions, Kubernetes CronJob, AWS) usually default to UTC.
How do I run a job every 90 minutes?
Standard cron can't express it directly. Use 0 0,3,6,9,12,15,18,21 * * * (every 3 hours) and gate inside the job, or use a systemd timer with OnCalendar=*-*-* 00,01:30:00 stepping.
Does cron catch missed jobs after a reboot?
Standard cron does not. anacron does for daily/weekly/monthly. systemd timers with Persistent=true run missed instances after boot.
Are cron expressions case-sensitive?
Numbers no. Names yes - use MON or mon consistently. Most parsers accept either.
