failover.io
  1. Home
  2. Cron schedules

Cron schedule examples

The crontab expression for every common schedule, from every minute to once a year.

Updated 19 November 20265 min read

Every common cron schedule in one place. The intervals people use most have their own page with next run times and the systemd and Kubernetes versions.

Every few minutes or hours

ScheduleExpression
Every minute* * * * *
Every 2 minutes*/2 * * * *
Every 5 minutes*/5 * * * *
Every 10 minutes*/10 * * * *
Every 15 minutes*/15 * * * *
Every 30 minutes*/30 * * * *
Every hour0 * * * *
Every 2 hours0 */2 * * *
Every 3 hours0 */3 * * *
Every 4 hours0 */4 * * *
Every 6 hours0 */6 * * *

Days, weeks, months and years

ScheduleExpressionRuns
Every 12 hours0 */12 * * *at 00:00 and 12:00
Every day at midnight0 0 * * *at 00:00 every day
Every day at a set time30 9 * * *at 09:30 every day; change 30 and 9 for another time
Every weekday0 9 * * 1-5at 09:00 Monday to Friday
Every Monday0 9 * * 1at 09:00 every Monday
Every Sunday0 0 * * 0at 00:00 every Sunday (7 also means Sunday)
Every week0 0 * * 0once a week, at 00:00 on Sunday; same as @weekly
Every month0 0 1 * *at 00:00 on the 1st of every month; same as @monthly
First day of the month at 08:000 8 1 * *at 08:00 on the 1st
Every year0 0 1 1 *at 00:00 on 1 January; same as @yearly

Try any of them below.

Meaning
#Local timeUTCIn

The five fields

┌ minute (0 to 59)
│ ┌ hour (0 to 23)
│ │ ┌ day of month (1 to 31)
│ │ │ ┌ month (1 to 12 or JAN to DEC)
│ │ │ │ ┌ day of week (0 to 6 or SUN to SAT, 7 is also Sunday)
* * * * * command
  • * means every value, */n every nth value starting at the lowest.
  • a-b is a range, a-b/n every nth value inside it, a,b,c a list.
  • When both day of month and day of week are set, the job runs when either matches. 0 0 13 * 5 runs on every 13th and on every Friday, not only on Friday the 13th.

Special strings like @daily, month and day names and the traps between cron versions: crontab syntax.

Which time zone cron uses

Cron uses the server's time zone. A server on UTC and a laptop in New York read the same line differently, which is why the tester shows both your local time and UTC. Kubernetes CronJobs use the controller's time zone unless you set spec.timeZone, and GitHub Actions schedules run in UTC unless a timezone key is set next to cron.

Daylight saving time can skip or repeat a run set between 01:00 and 03:00, depending on the cron version. Keeping servers on UTC avoids it.

Know when a scheduled job stops

Add && curl -fsS -m 10 -X POST https://api.failover.io/heartbeat/<your-monitor-id> after the command and set a heartbeat monitor to the same interval. If a run fails or never starts, the ping doesn't arrive and you get an alert. See how to monitor cron jobs.

Frequently asked questions

What is the cron expression for every day at midnight?

0 0 * * *. Most cron versions also accept @daily or @midnight.

How do I run a cron job every weekday?

0 9 * * 1-5 runs at 09:00 Monday to Friday. Change 9 for another hour.

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

0 0 1 * * runs at midnight on the 1st. Cron has no "last day of the month"; a common trick is to run daily and check the date in the script.

Can cron run a job every 30 seconds?

Not directly; the smallest step is one minute. Use two lines, the second starting with sleep 30;, or a systemd timer.