Cron expression for every 4 hours
Runs the job every fourth hour, six times a day.
0 */4 * * *
On the hour, every 4 hours
Field by field
- Minute · 0–59
0only at minute 0 - Hour · 0–23
*/4every 4th hour - Day of month · 1–31
*every day of the month - Month · 1–12 or JAN–DEC
*every month - Day of week · 0–7 or SUN–SAT
*every day of the week
Next runs in your local time
Where this cron expression shows up
- Backups that are too heavy for every couple of hours
- Pulling data from a system that publishes a few times a day
- Cache and index refreshes that people will not notice happening
Common variations
-
Every two hours
0 */2 * * * On the hour, every 2 hours
-
Every six hours
0 */6 * * * On the hour, every 6 hours
-
Every four hours inside the working day
0 8-20/4 * * * On the hour, every 4 hours, between 08:00 AM and 08:00 PM
The step counts from midnight, so the runs are 00:00, 04:00, 08:00, 12:00, 16:00 and 20:00. A job that takes an hour does not shift the next one: the grid stays where it is.
Ranges, steps, and names are spelled out on the cheat sheet.