A cron expression is five fields separated by spaces: minute, hour, day of month, month and day of week. */5 * * * * runs every 5 minutes, 0 0 * * * runs every day at midnight, and 0 9 * * 1-5 runs at 9:00 AM Monday through Friday. Spring and Quartz put a seconds field first and AWS EventBridge adds a year at the end, so the cron expression examples below include a conversion table for those dialects. Paste any of them into the Cron Expression Explainer to read it in plain English and see its next run times in your scheduler's time zone.
How to check a cron expression with Zutilium
- Open the Cron Expression Explainer and type or paste into the Cron expression box. A whole crontab line with its command, a YAML
cron:line, an EventBridgecron(…)expression or a Spring@Scheduled(…)annotation also works: the parts that are not fields are set aside. - Check the line under Dialect, which says how the expression was read, for example "Read as Standard cron: 5 fields." If the guess is wrong, choose the right dialect from the Dialect menu instead of Auto-detect.
- Read the plain-English sentence and the Field by field table. A mistake is highlighted, and the message names the field and the character.
- Under Next run times, set Time zone to the zone your scheduler uses and choose 5, 10 or 25 under Show.
- Select Copy explanation, Copy run times or Download report (.txt) to keep the result.
Check that the run list matches what you meant, especially around weekends and month ends; runs that a clock change moves, skips or repeats are marked. Common schedules loads ready-made examples. Everything runs in your browser, so expressions are never uploaded or stored.
Crontab syntax: the five fields
┌───────────── 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
Each field takes numbers, three-letter names (month and day of week only) and four operators:
| Operator | Meaning | Example |
|---|---|---|
* |
Every value | * in the hour field: every hour |
, |
List | 1,15: the 1st and the 15th |
- |
Inclusive range | 9-17: 9 AM through 5 PM |
/ |
Step through a range | */15: minutes 0, 15, 30 and 45 |
A step counts from the start of its range and starts again every hour, day or month. */7 in the minute field runs at :49 and :56, then at :00, only four minutes later, and */45 runs at :00 and :45 rather than every 45 minutes.
To offset a step, write a range: 2-59/5 runs at :02, :07 and so on through :57. The short form 2/5 works in Kubernetes, but cronie and Vixie cron reject it.
Names work in any case (JAN, mon). cronie's crontab manual allows ranges of names such as MON-FRI, but Debian's cron manual rules them out, so numbers are safer in a crontab.
cronie also accepts shortcuts in place of the five fields: @hourly (0 * * * *), @daily or @midnight (0 0 * * *), @weekly (0 0 * * 0), @monthly (0 0 1 * *), @yearly or @annually (0 0 1 1 *) and @reboot, which runs once when cron starts. Kubernetes and Spring accept the same shortcuts except @reboot, and GitHub Actions accepts none of them.
A crontab line is the expression followed by the command:
# min hour dom mon dow command
*/5 * * * * /usr/local/bin/check-queue.sh >> /tmp/check-queue.log 2>&1
Edit your crontab with crontab -e and list it with crontab -l. In the command, cron turns every % into a new line unless you escape it as \%.
Cron expression examples for common schedules
These use the five standard fields shared by crontab, Kubernetes CronJobs and GitHub Actions; the Spring, Quartz and EventBridge versions come later.
Cron every 5 minutes and other intervals
| Schedule | Expression |
|---|---|
| Every minute | * * * * * |
| Every 5 minutes | */5 * * * * |
| Every 10 minutes | */10 * * * * |
| Every 15 minutes | */15 * * * * |
| Every 30 minutes | */30 * * * * |
| Every 5 minutes, starting at :02 | 2-59/5 * * * * |
| Every hour, on the hour | 0 * * * * |
| Every 2 hours | 0 */2 * * * |
| Every 6 hours (12 AM, 6 AM, 12 PM, 6 PM) | 0 */6 * * * |
| Every 5 minutes, 9:00 AM to 5:55 PM, weekdays | */5 9-17 * * 1-5 |
*/5 runs at :00, :05 and so on through :55, 12 times an hour. GitHub Actions allows nothing more frequent than every 5 minutes, and EventBridge nothing faster than once a minute.
An interval that does not divide evenly into an hour or a day needs more than one line. For every 90 minutes, 0 0-21/3 * * * runs at 12:00 AM, 3:00 AM and so on through 9:00 PM, and 30 1-22/3 * * * fills the gaps at 1:30 AM, 4:30 AM and so on through 10:30 PM.
Cron job every day at midnight and other daily times
| Schedule | Expression |
|---|---|
| Every day at midnight | 0 0 * * * or @daily |
| Every day at 2:30 AM | 30 2 * * * |
| Every day at 9:00 AM | 0 9 * * * |
| Every day at noon | 0 12 * * * |
| Every day at 11:59 PM | 59 23 * * * |
| Twice a day, 8:00 AM and 8:00 PM | 0 8,20 * * * |
| 9:00 AM and 5:30 PM | Two lines: 0 9 * * * and 30 17 * * * |
Midnight is hour 0 in the scheduler's time zone, which is UTC on GitHub Actions unless the schedule sets one; there is no hour 24. A common slip is * 0 * * *, which runs every minute from 12:00 to 12:59 AM. Lists in the minute and hour fields combine, so 0,30 9,17 * * * runs at 9:00 AM, 9:30 AM, 5:00 PM and 5:30 PM, and times that share neither the minute nor the hour need separate lines.
Weekly and weekday schedules
| Schedule | Expression |
|---|---|
| Weekdays at 9:00 AM | 0 9 * * 1-5 |
| Weekends at 10:00 AM | 0 10 * * 6,0 |
| Every Monday at 8:00 AM | 0 8 * * 1 |
| Every Friday at 5:00 PM | 0 17 * * 5 |
| Monday, Wednesday and Friday at 6:30 AM | 30 6 * * 1,3,5 |
| Every Sunday at 3:00 AM | 0 3 * * 0 |
| Every hour, 9 AM to 5 PM, weekdays | 0 9-17 * * 1-5 |
Ranges include both ends, so 0 9-17 * * 1-5 last runs at 5:00 PM, and */5 9-17 * * 1-5 at 5:55 PM.
Monthly, quarterly and yearly schedules
| Schedule | Expression |
|---|---|
| 1st of every month at midnight | 0 0 1 * * or @monthly |
| 15th of every month at noon | 0 12 15 * * |
| 1st and 15th at 9:00 AM | 0 9 1,15 * * |
| Every quarter (January, April, July, October) | 0 0 1 */3 * |
| January 1 at midnight | 0 0 1 1 * or @yearly |
| February 29 at midnight | 0 0 29 2 * |
| Last day of the month | Not in five-field cron |
| First Monday of the month | Not in one five-field line |
A day that a month lacks is skipped: 0 0 31 * * runs in only seven months, 0 0 29 2 * waits for leap years (February 29, 2028 is next), and 0 0 31 2 * never runs.
For the last day of the month, Spring, Quartz and EventBridge have L. In a crontab, run on the 28th to the 31st and let the command check that tomorrow is the 1st, here with GNU date on Linux:
55 23 28-31 * * [ "$(date -d tomorrow +\%d)" = 01 ] && /usr/local/bin/month-end.sh
Running just after midnight on the 1st and processing the previous month is often simpler.
The day-of-month and day-of-week trap
When both day fields are restricted (neither is *), cron runs on days that match either field, not only on days that match both. POSIX defines this rule, crontab and Kubernetes follow it, and GitHub Actions documents POSIX syntax.
So 0 9 1 * 1 does not mean "the 1st, if it is a Monday". It runs on the 1st of every month and on every Monday. From November 26, 2026 its next runs are Monday, November 30; Tuesday, December 1; Mondays December 7, 14, 21 and 28; then Friday, January 1, 2027.
The classic mistake is 0 9 1-7 * 1 for "the first Monday of the month". In December 2026 it runs 10 times: every day from the 1st to the 7th, plus Mondays the 14th, 21st and 28th.
In a crontab, the fix is to keep the date range in cron and test the weekday in the command. date +%u prints 1 on Mondays:
0 9 1-7 * * [ "$(date +\%u)" = 1 ] && /usr/local/bin/monthly-report.sh
- Kubernetes and GitHub Actions: schedule
0 9 1-7 * *and make the job stop early unless it is Monday. - Spring, Quartz and EventBridge: use
#.0 0 9 ? * MON#1(Spring),0 0 9 ? * 2#1(Quartz) andcron(0 9 ? * 2#1 *)(EventBridge) run on December 7, 2026, then January 4, February 1 and March 1, 2027.
One more quirk: cronie and Vixie cron decide whether a day field is restricted by its first character alone. A step such as */2 therefore counts as unrestricted, so both fields have to match, whereas Kubernetes reads */2 as restricted and accepts either. Avoid steps in one day field when the other is set.
In the other dialects the trap cannot happen: Spring always requires both fields to match, and Quartz and EventBridge make you put ? in one of them.
Cron syntax in Spring, Quartz, AWS EventBridge, GitHub Actions and Kubernetes
| Platform | Fields | Sunday | Both day fields set |
|---|---|---|---|
| crontab (cronie, Vixie cron) | 5 | 0 or 7 | Either matches |
| Kubernetes, GitHub Actions | 5 | 0 (0–6 documented) | Either matches |
Spring @Scheduled |
6, seconds first | 0 or 7 | Both must match |
| Quartz | 6 or 7, seconds first, optional year | 1 | Not allowed: use ? |
| AWS EventBridge | 6, year last | 1 | Not allowed: use ? |
The same schedules in each dialect:
| Schedule | crontab, Kubernetes, GitHub | Spring | Quartz | EventBridge |
|---|---|---|---|---|
| Every 5 minutes | */5 * * * * |
0 */5 * * * * |
0 0/5 * * * ? |
cron(0/5 * * * ? *) |
| Daily at midnight | 0 0 * * * |
0 0 0 * * * |
0 0 0 * * ? |
cron(0 0 * * ? *) |
| Weekdays at 9:00 | 0 9 * * 1-5 |
0 0 9 * * MON-FRI |
0 0 9 ? * MON-FRI |
cron(0 9 ? * MON-FRI *) |
| 1st of the month at 6:00 | 0 6 1 * * |
0 0 6 1 * * |
0 0 6 1 * ? |
cron(0 6 1 * ? *) |
| Last day at 23:00 | None | 0 0 23 L * * |
0 0 23 L * ? |
cron(0 23 L * ? *) |
| First Monday at 9:00 | None | 0 0 9 ? * MON#1 |
0 0 9 ? * 2#1 |
cron(0 9 ? * 2#1 *) |
| Every 30 seconds | None | */30 * * * * * |
0/30 * * * * ? |
None |
Weekday numbers cause the most mistakes when you move a schedule: 1-5 means Monday to Friday in crontab and Spring but Sunday to Thursday in Quartz and EventBridge, and both are valid, so nothing warns you. The last Friday of the month is 5L in Spring's CronExpression but 6L in Quartz's CronTrigger and EventBridge Scheduler. Names such as MON-FRI mean the same in every dialect that accepts them.
In Kubernetes and GitHub Actions the expression lives in YAML. Quote it: YAML reads a value that starts with * as an alias, so an unquoted */5 * * * * breaks the file.
# Kubernetes CronJob
spec:
schedule: "0 9 * * 1-5"
timeZone: "America/New_York"
# GitHub Actions workflow
on:
schedule:
- cron: "0 9 * * 1-5"
timezone: "America/New_York"
If you write these files from JSON, the JSON to YAML Converter quotes a value such as */5 * * * * for you, and the guide to YAML gotchas covers the other surprises.
Cron time zones and daylight saving time
A cron expression has no time zone of its own; the scheduler supplies one.
| Platform | Default time zone | To change it |
|---|---|---|
| crontab | The server's local time | A CRON_TZ= line (cronie) |
| Kubernetes CronJob | The kube-controller-manager's local time | spec.timeZone |
| GitHub Actions | UTC | timezone: with an IANA name |
Spring @Scheduled |
The scheduler's time zone | zone = "Europe/Berlin" |
| Quartz | The system's default time zone | Set it on the trigger |
| EventBridge Scheduler | UTC | The schedule's time zone |
In Kubernetes CronJobs, spec.timeZone has been stable since v1.27, and CRON_TZ= or TZ= inside spec.schedule is rejected.
Without a time zone, GitHub Actions schedules read 0 14 * * 1-5 as 14:00 UTC, which is 9:00 AM in New York in winter (EST, UTC−5) but 10:00 AM in summer (EDT, UTC−4). With timezone: "America/New_York", 0 9 * * 1-5 stays at 9:00 AM all year. To find the UTC hour for a local time on a given date, use the Time Zone Meeting Planner.
What happens when the clocks change
Clock changes skip or repeat an hour of local time: 1:00 to 1:59 AM in London, 2:00 to 2:59 AM in Paris and Berlin, 3:00 to 3:59 AM in Helsinki and Athens. In 2027, New York skips 2:00 to 2:59 AM on March 14 and repeats 1:00 to 1:59 AM on November 7.
cronie runs a skipped fixed-time job right after the jump and a repeated one once, GitHub Actions moves a skipped run to the next valid time, and EventBridge Scheduler skips it and runs a repeated time once, at the second occurrence.
Keep important jobs out of the hour your zone's clocks change, or schedule in UTC; the explainer marks moved, skipped and repeated runs in any zone. If your logs record runs as Unix timestamps, the Unix Timestamp Converter turns them into dates in the same zone for comparison.
Troubleshooting
The command works in a terminal but not from cron
Cron starts commands with /bin/sh and its own small environment, not your login shell's, so use full paths and set the variables the script needs. An unescaped % cuts the command short, because cron turns it into a new line. Append >> /tmp/job.log 2>&1 to capture the error message.
A GitHub Actions schedule runs late or not at all
Runs can be delayed at busy times, especially at the start of each hour, and some may be dropped, so choose another minute. Schedules run only on the default branch, and in a public repository they are disabled after 60 days without repository activity.
Kubernetes rejects the schedule
CRON_TZ= or TZ= inside spec.schedule fails validation, so set spec.timeZone instead. Kubernetes documents day-of-week values 0 to 6, so write Sunday as 0 or SUN, not 7.
Quartz or EventBridge says the expression is invalid
Both need ? in the day-of-month or the day-of-week field: 0 0 9 * * * fails in Quartz and cron(0 9 * * * *) in EventBridge, while 0 0 9 * * ? and cron(0 9 * * ? *) work. EventBridge also needs exactly six fields and has no / steps in the day-of-week field.
Frequently asked questions
What is the cron expression for every 5 minutes?
*/5 * * * * runs at minutes 0, 5, 10 and so on through 55 of every hour. In Spring it is 0 */5 * * * *, in Quartz 0 0/5 * * * ? and in EventBridge cron(0/5 * * * ? *) or rate(5 minutes). Every 5 minutes is also the most often GitHub Actions will run a schedule.
How do I run a cron job every day at midnight?
Use 0 0 * * *, or @daily where shortcuts are supported (not on GitHub Actions). It runs at midnight in the scheduler's time zone, so on GitHub Actions that means midnight UTC unless the schedule sets timezone. Spring uses 0 0 0 * * * and Quartz 0 0 0 * * ?.
Is Sunday 0 or 7 in cron?
In crontab and Spring, both 0 and 7 mean Sunday, but Kubernetes and GitHub Actions document only 0 to 6, and Quartz and AWS EventBridge count from 1 for Sunday to 7 for Saturday. So SUN is the portable choice: 0 also works in crontab, Spring, Kubernetes and GitHub Actions, but not in Quartz or EventBridge.
Can a cron job run every 30 seconds?
Not with five fields, because the smallest unit is a minute. Spring (*/30 * * * * *) and Quartz (0/30 * * * * ?) have a seconds field. In a crontab, a common workaround is two lines that run every minute, the second starting with sleep 30; before the command.