Cron Every 4 Hours
Run a cron job every 4 hours using 0 */4 * * *. Complete field breakdown with real-world examples and cross-platform scheduling guidance.
Cron Expression
0 */4 * * *
Field Breakdown
| Field | Value | Meaning |
|---|---|---|
| Minute | 0 | At 0 |
| Hour | */4 | Every 4th hour |
| Day of Month | * | Every day of the month (1–31) |
| Month | * | Every month (1–12) |
| Day of Week | * | Every day of the week (Sun–Sat) |
Detailed Explanation
The cron expression 0 */4 * * * schedules a task to run once every four hours, at the top of every fourth hour.
Field-by-field breakdown:
0(Minute): At minute 0 only. The task fires at the start of the hour.*/4(Hour): Every 4th hour, starting from hour 0. The step value/4triggers execution at hours 0, 4, 8, 12, 16, and 20.*(Day of Month): Every day from 1 through 31. No restriction on the day of the month.*(Month): Every month from January through December. No restriction on the month.*(Day of Week): Every day of the week from Sunday through Saturday. No restriction on the day.
This means your task will execute 6 times per day, evenly distributed throughout the 24-hour period. The four-hour interval divides the day into six equal windows and is popular for tasks that benefit from periodic execution without needing to run hourly. Each execution window provides a generous four-hour buffer, making this well suited for resource-intensive operations like data processing pipelines. This expression is supported by standard cron on Linux/macOS, as well as cloud services like AWS CloudWatch, Google Cloud Scheduler, and GitHub Actions.
Use Case
Commonly used for regenerating search indexes on a content platform to ensure newly published articles are discoverable within a few hours.
Try It — Interactive Builder
Every 4 hours
Next 10 Executions
Ctrl+Shift+C to copy expression