Free tool · runs in your browser
Cron expression generator and explainer
minute hour day-of-month month day-of-week. */5 * * * * means every 5 minutes.“Every 5 minutes”
- Minute
- */5
- 0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55
- Hour
- *
- every value
- Day of month
- *
- every value
- Month
- *
- every value
- Day of week
- *
- every value
Next 5 runs
Cron reads the schedule in the server's time zone. Pick which one it uses.
Working out run times…
Build it field by field
"at / on" takes a value, a list (1,15), a range (9-17) or names (MON-FRI, JAN).
*/5 * * * * /path/to/script.sh >> /var/log/script.log 2>&1Cron format
┌───────────── minute (0-59) │ ┌─────────── hour (0-23) │ │ ┌───────── day of month (1-31) │ │ │ ┌─────── month (1-12 or JAN-DEC) │ │ │ │ ┌───── day of week (0-7 or SUN-SAT; 0 and 7 are Sunday) │ │ │ │ │ * * * * * command to run
| Character | Meaning | Example |
|---|---|---|
| * | Any value | * in hour = every hour |
| , | List | 1,15 in day of month = the 1st and the 15th |
| - | Range | 1-5 in day of week = Monday to Friday |
| / | Step | */15 in minute = minutes 0, 15, 30 and 45 |
| a-b/n | Step in a range | 9-17/2 in hour = 9, 11, 13, 15 and 17 |
| JAN, MON | Names | MON-FRI in day of week = month and weekday names, any case |
| Macro | Same as |
|---|---|
| @yearly, @annually | 0 0 1 1 * |
| @monthly | 0 0 1 * * |
| @weekly | 0 0 * * 0 |
| @daily, @midnight | 0 0 * * * |
| @hourly | 0 * * * * |
| @reboot | once, when cron starts |
When both day fields are set (neither starts with *), a day matches if either one does: 30 4 1,15 * 5 runs at 4:30 on the 1st, the 15th and every Friday. Standard cron has no seconds field and no ?, L, W or #; those belong to Quartz, Spring and AWS.
Common cron schedules
| Expression | Runs | Copy |
|---|---|---|
| * * * * * | Every minute | |
| */5 * * * * | Every 5 minutes | |
| */10 * * * * | Every 10 minutes | |
| */15 * * * * | Every 15 minutes | |
| */30 * * * * | Every 30 minutes | |
| 0 * * * * | Every hour, on the hour | |
| 0 */2 * * * | Every 2 hours | |
| 0 */6 * * * | Every 6 hours (00:00, 06:00, 12:00, 18:00) | |
| 0 0,12 * * * | Twice a day, at midnight and noon | |
| 0 0 * * * | Every day at midnight | |
| 0 9 * * * | Every day at 9:00 | |
| 0 9 * * 1-5 | Weekdays (Monday to Friday) at 9:00 | |
| 0 10 * * 6,0 | Saturday and Sunday at 10:00 | |
| 0 9 * * 1 | Every Monday at 9:00 | |
| 0 0 * * 0 | Every Sunday at midnight (same as @weekly) | |
| 0 0 1 * * | First day of every month at midnight (same as @monthly) | |
| 0 0 1,15 * * | The 1st and 15th of every month at midnight | |
| 0 0 1 */3 * | Every quarter: 1 January, April, July and October | |
| 0 0 1 1 * | Once a year, 1 January at midnight (same as @yearly) |
Cron on other platforms
“Cron” means slightly different syntax depending on where it runs. The same schedule, every 5 minutes, in each one:
| Platform | Fields | Every 5 minutes | Time zone |
|---|---|---|---|
| crontab (Linux, macOS) | 5 | */5 * * * * | Server local time |
| Quartz (Java) | 6-7, seconds first, optional year | 0 0/5 * * * ? | JVM default, or set on the trigger |
| Spring @Scheduled | 6, seconds first | 0 */5 * * * * | Server local, or the zone attribute |
| Jenkins | 5, plus H | H/5 * * * * | Controller time zone |
| GitHub Actions | 5 | */5 * * * * | UTC, or a timezone key |
| Kubernetes CronJob | 5 | */5 * * * * | Controller manager, or spec.timeZone |
| AWS EventBridge | 6, year last, no seconds | cron(0/5 * * * ? *) | UTC, or a schedule time zone (Scheduler) |
crontab (Linux, macOS, BSD)
Five fields, edited with crontab -e. Day of week is 0-7 where 0 and 7 are both Sunday, and month and day names work. A % in the command becomes a newline unless you escape it as \%. The schedule follows the server's local time zone. This tool follows these rules.
Quartz and Spring (Java)
Both put a seconds field first. Quartz takes 6 or 7 fields (the 7th is an optional year), numbers weekdays 1-7 with SUN as 1, and needs ? in either day of month or day of week: 0 0 12 ? * MON-FRI. Spring takes exactly 6 fields, uses 0-7 for weekdays like crontab, and allows ? instead of * in the day fields. Both support L (last), W (nearest weekday) and # (nth weekday). Quartz docs · Spring docs
Jenkins (H hash syntax)
Jenkins uses the five crontab fields plus H, a hash of the job name. H H * * * runs once a day at a time fixed for that job, so a hundred jobs don't all start at midnight. H/15 * * * * runs every 15 minutes (perhaps :07, :22, :37, :52) and H(0-29)/10 * * * * every 10 minutes in the first half hour. The aliases @hourly, @daily and the rest use the hash too, so @hourly means H * * * *. Use it in a pipeline as triggers { cron('H */4 * * 1-5') }. Jenkins docs
GitHub Actions schedule
on: schedule: - cron: '*/15 * * * *' takes the five crontab fields. It runs in UTC unless you add an IANA timezone key next to cron. The shortest interval is every 5 minutes. Runs can be delayed when load is high, the start of every hour is busiest, and under enough load some runs are dropped, so avoid 0 * * * * for anything time-sensitive. Schedules only run on the default branch, and in public repos they turn off after 60 days with no repository activity. GitHub docs
Kubernetes CronJob
.spec.schedule uses the five crontab fields and the macros (@hourly and so on); ? means the same as *. Without a time zone, the kube-controller-manager's local time zone applies. Set .spec.timeZone: "Etc/UTC" (stable since v1.27) to pin it. CRON_TZ= or TZ= inside the schedule is rejected with a validation error. Kubernetes docs
AWS EventBridge
cron(minutes hours day-of-month month day-of-week year): six fields, no seconds, and a year at the end. Weekdays are 1-7 or SUN-SAT. You can't use * in both day fields; one must be ?, as in cron(0 9 ? * MON-FRI *). L, W and # work. EventBridge Scheduler evaluates in UTC or a time zone you set; the older scheduled rules run in UTC and can't go faster than once a minute. AWS docs
DevOps tools on DevHunt · is GitHub, AWS or Vercel down? · more free developer tools
FAQ
How do I run a cron job every 5 minutes?+
Use */5 * * * *. It runs at minute 0, 5, 10 and so on up to 55 of every hour. On Jenkins, H/5 * * * * does the same but starts at a minute picked from the job name, so jobs don’t all fire at once.
What time zone does cron use?+
Classic cron uses the server’s local time zone, so check it with date or timedatectl. GitHub Actions schedules run in UTC unless you add a timezone key. Kubernetes uses the kube-controller-manager’s time zone unless you set spec.timeZone. AWS EventBridge Scheduler uses UTC unless you give the schedule a time zone.
How do I run a cron job on the last day of the month?+
Standard cron has no L (last day). Schedule it on days 28-31 and let the command check that tomorrow is the 1st: 0 23 28-31 * * [ "$(date -d tomorrow +\%d)" = 01 ] && /path/to/script.sh. Escape % as \% inside a crontab line, because cron turns a bare % into a newline. date -d is GNU date; on macOS and BSD use date -v+1d +\%d.
Why does 0 0 1 * MON run every Monday, not only on Mondays that are the 1st?+
When both day fields are restricted (neither starts with *), cron runs the job when either one matches. So 0 0 1 * MON runs on the 1st of every month and on every Monday. If one of the two fields is *, only the other one counts.
Does */7 run every 7 minutes?+
Not exactly. A step counts from the start of its field and restarts every hour, so */7 runs at minutes 0, 7, 14 … 56, then again at 0. The gap between :56 and :00 is 4 minutes. For a true fixed interval, use a step that divides 60 (5, 10, 15, 20, 30) or a systemd timer.
What does H mean in a Jenkins cron?+
H is a hash of the job name. Jenkins swaps it for a fixed value in the field’s range, so H H * * * runs each job once a day at its own time instead of every job at midnight. H/15 * * * * runs every 15 minutes at a job-specific offset, and H(0-29)/10 limits it to the first half of the hour.
Can cron run a job every 30 seconds?+
No. Standard cron’s smallest unit is one minute. A common workaround is two lines: * * * * * /path/to/job and * * * * * sleep 30; /path/to/job. Quartz and Spring cron have a seconds field, so 0/30 * * * * ? (Quartz) or */30 * * * * * (Spring) works there.