Cron · Hours

0 */5 * * *

Every 5 hours (not really)

At 00:00, 05:00, 10:00, 15:00 and 20:00. The gap after 20:00 is only 4 hours.

Runs per day5
Runs per week35
Runs per year (2027)1,825
Gap between runsuneven: 4 hours / 5 hours
Time of day00:00, 05:00, 10:00, 15:00, 20:00

Open in the explainer

24 isn't divisible by 5, so */5 restarts at midnight and the last gap of the day is shorter.

Next run times

  1. Calculating…

Field by field

FieldValueMeans
Minute (0-59)0:00
Hour (0-23)*/5every 5 hours, starting at 0 (00:xx, 05:xx, 10:xx, 15:xx and 20:xx)
Day of month (1-31)*every day of the month
Month (1-12)*every month
Day of week (0-7, 0 and 7 = Sunday)*every day of the week

The same schedule on other platforms

PlatformWrite it asNotes
Linux crontab0 */5 * * * /path/to/script.shRuns in the server's time zone.
Kubernetes CronJobschedule: "0 */5 * * *"Add timeZone: "Etc/UTC" (or any tz name) under spec; without it, the controller's time zone is used.
GitHub Actions- cron: '0 */5 * * *'Runs in UTC unless you add timezone: under the cron line. Runs can be delayed, especially at the start of the hour.
Jenkinscron('0 */5 * * *')Same five fields. Jenkins recommends H to spread load: H */5 * * * runs at the same rate but at a minute picked from the job name.
Quartz0 0 0/5 * * ?Seconds come first; one of the two day fields must be ?.
AWS EventBridgecron(0 0/5 * * ? *)Six fields, year last; one day field must be ?.
Spring @Scheduled@Scheduled(cron = "0 0 */5 * * *")Seconds come first.
Azure Functions0 0 */5 * * *Seconds come first. Runs in UTC unless the app setting WEBSITE_TIME_ZONE is set.
systemd timerOnCalendar=*-*-* 00,05,10,15,20:00:00Checked with systemd-analyze calendar.

Schedulers also differ in day-of-week numbering, time zones, special characters like L and ?, and what happens when the clocks change. Every one is compared, with links to its official docs, in the cron dialect registry.

Watch out for

The gaps aren't even

Consecutive runs are 4 hours and 5 hours apart. A step restarts at midnight, and 24 isn't divisible by 5.

For a true fixed interval that doesn't divide the hour or day, use a systemd timer with OnUnitActiveSec=, or have the job check the time since its last run.

Common mistakes

* */5 * * * looks similar but has * in the minute field, so it runs every minute of each matching hour: 300 times a day instead of 5. The minute must be a number, as in 0 */5 * * *.

The count also restarts every day at midnight: it is not measured from when you saved the crontab or from the last run. To run a fixed time after the previous run, see the systemd option below.

How to really run every 5 hours

24 hours isn't a multiple of 5 hours, so no set of cron lines can repeat it day after day. Use a systemd timer that counts from the previous run (below), or a loop in a long-running process.

Every 5 hours after the last run (systemd)

cron only knows clock times. If you need a gap measured from the previous run, a systemd timer can do it:

[Timer]
OnBootSec=5min
OnUnitActiveSec=5h
AccuracySec=1s

OnUnitActiveSec= counts from when the job last started; OnUnitInactiveSec= counts from when it last finished. Set AccuracySec=: the default of 1 minute lets systemd fire up to a minute late to save wake-ups.

If a run can take longer than the gap

Unix cron doesn't check whether the previous run has finished before starting the next one. Wrap the command in flock -n so a new run gives up immediately (exit status 1) while the old one holds the lock:

0 */5 * * * flock -n /tmp/myjob.lock /path/to/script.sh

flock comes from util-linux.

Avoid running exactly on the hour

Many schedules fire at :00, and that's when shared schedulers are busiest. GitHub's docs say scheduled runs can be delayed during high load, especially at the start of every hour. Ways to move off :00:

  • Pick a fixed odd minute: 17 */5 * * *.
  • Jenkins: H */5 * * *. Jenkins picks a minute from a hash of the job name, so each job gets its own stable minute.
  • cronie (Fedora, RHEL, Amazon Linux, Arch): ~ */5 * * * picks a random minute when the crontab is loaded, and RANDOM_DELAY= adds a random delay. Debian/Ubuntu cron rejects ~.
  • systemd: RandomizedDelaySec= adds a new random delay each time.

Related schedules

Step-by-step guide: How to run a cron job every hour. All schedules: common cron expressions. Checking a whole crontab file? Use the crontab checker.

Sources

Run times were checked against an independent cron library (croniter) and this site's engine; every platform version above was parsed and compared run-for-run, and the systemd line was checked with systemd-analyze calendar. Last verified 18 November 2026.