Skip to content
Webmaster Tools

Cron every 3 hours

The cron expression for every 3 hours is 0 */3 * * *: 0, 3, 6 … 21 o'clock. Offsets, why some hour steps leave uneven gaps, and the GitHub Actions and AWS forms.

Cron expression
0 */3 * * *
See the next run times

The expression

0 */3 * * *

Runs at minute 0 of hours 0, 3, 6, 9, 12, 15, 18 and 21: 00:00, 03:00 … 21:00, eight times a day. The step restarts at midnight, and because 24 divides evenly by 3, the last gap (21:00 to 00:00) is also 3 hours.

Field Value Meaning
Minute 0 at minute 0
Hour */3 every 3rd hour, starting at 0
Day of month * every day
Month * every month
Day of week * every day of the week

*/3 in the hour field is the list 0,3,6,9,12,15,18,21. It doesn't count from when the crontab was saved: install it at 10:20 and the first run is 12:00.

Variants

Schedule Expression
Every 3 hours from 1:00 (1, 4, 7 … 22) 0 1-23/3 * * *
Every 3 hours from 2:00 (2, 5, 8 … 23) 0 2-23/3 * * *
Every 3 hours at quarter past 15 */3 * * *
Every 3 hours, weekdays only 0 */3 * * 1-5
Every 2 hours 0 */2 * * *
Every 4 hours 0 */4 * * *
Every 6 hours 0 */6 * * *

Steps that don't divide 24

Only 1, 2, 3, 4, 6, 8 and 12 give an even gap all day. 0 */5 * * * runs at 0, 5, 10, 15 and 20, then again at 00:00 only 4 hours later. 0 */7 * * * runs at 0, 7, 14 and 21, followed by a 3-hour gap. If you need a true 5- or 7-hour cadence, cron alone can't do it; use a systemd timer with OnUnitActiveSec=5h, or a job that checks the time since its last run.

Where to write it

  • crontab (Linux, macOS): 0 */3 * * * /usr/local/bin/sync.sh in crontab -e, in the server's time zone.
  • GitHub Actions: on: schedule: - cron: '0 */3 * * *'. The hours are UTC: in New York (UTC-5 in winter) that's 19:00, 22:00, 01:00 and so on. Avoid minute 0, the busiest slot.
  • Kubernetes CronJob: schedule: "0 */3 * * *", with timeZone: to pin the hours to a local zone.
  • AWS EventBridge: cron(0 0/3 * * ? *), with ? in day of week. rate(3 hours) also works but counts from rule creation, not from midnight.

Common mistakes

  • */3 * * * * runs every 3 minutes. The hour step goes in the second field.
  • * */3 * * * runs 60 times in each matching hour.
  • Assuming it continues across midnight. Every day starts over at 00:00, which is why */5 and */7 leave a short gap at the end of the day.

Paste any expression into the Cron Expression Parser to see it in words and its next run times.