failover.io
  1. Home
  2. Cron schedules
  3. Every 3 hours

Run a cron job every 3 hours

0 */3 * * * runs at 00:00, 03:00, 06:00, 09:00, 12:00, 15:00, 18:00 and 21:00, 8 times a day.

Updated 19 November 20264 min read

The cron expression to run a job every 3 hours is:

0 */3 * * * /path/to/command

It runs at 00:00, 03:00, 06:00, 09:00, 12:00, 15:00, 18:00 and 21:00, 8 times a day. Change the expression below to try a variant; the next runs are shown in your time zone and in UTC.

Meaning
#Local timeUTCIn

What each field means

FieldPositionMeans
0Minute (0 to 59)only 0
*/3Hour (0 to 23)every 3rd value, starting at 0
*Day of month (1 to 31)every value
*Month (1 to 12)every value
*Day of week (0 to 6, Sunday is 0)every value

Steps that don't divide 24

*/3 works evenly because 24 divides by 3. A step that doesn't divide 24, like */5 in the hour field, runs at 00, 05, 10, 15 and 20, then again at 00: the last gap is 4 hours, not 5. Cron counts within each day; it never carries over to the next one.

The same schedule elsewhere

WhereHow to write it
crontab0 */3 * * * /path/to/command
systemd timerOnCalendar=*-*-* 0/3:00:00
Kubernetes CronJobschedule: "0 */3 * * *"
GitHub Actions- cron: "0 */3 * * *" (UTC by default)

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 table above 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 the job stops running

Cron doesn't tell anyone when a job stops: a rebuilt server without its crontab, a full disk or a script that starts failing all look like silence. Add a heartbeat ping after the command, so it only fires when the command succeeds:

0 */3 * * * /path/to/command && curl -fsS -m 10 -X POST https://api.failover.io/heartbeat/<your-monitor-id>

On failover.io, create a heartbeat monitor with an expected interval of 10800 seconds and a grace period of about 20 minutes. If a ping is late, the alert goes out by email, Slack or Telegram, and on paid plans by SMS and phone call. The full setup is in how to monitor cron jobs.

Other schedules: every cron schedule example. To check any expression, use the cron expression tester.

Frequently asked questions

What is the cron expression for every 3 hours?

0 */3 * * *. It runs at 00:00, 03:00, 06:00, 09:00, 12:00, 15:00, 18:00 and 21:00, 8 times a day.

How do I run a cron job every 3 hours?

Run crontab -e, add the line 0 */3 * * * /path/to/command with the full path to your script, then save. Cron picks up the change without a restart.

Which time zone does the schedule use?

The server's time zone. Check it with timedatectl or date. GitHub Actions uses UTC unless the workflow sets timezone.

How do I know if my every 3 hours cron job stopped running?

Add a heartbeat ping after the command with &&. A monitor that expects the ping alerts you when it is late, which catches both failed runs and runs that never started.