Cron Every 6 Hours
Schedule a cron job every 6 hours with 0 */6 * * *. Detailed explanation of each cron field, practical use cases, and configuration tips.
Cron Expression
0 */6 * * *
Field Breakdown
| Field | Value | Meaning |
|---|---|---|
| Minute | 0 | At 0 |
| Hour | */6 | Every 6th 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 */6 * * * schedules a task to run once every six hours, at the top of every sixth hour.
Field-by-field breakdown:
0(Minute): At minute 0 only. The task fires at the start of the hour.*/6(Hour): Every 6th hour, starting from hour 0. The step value/6triggers execution at hours 0, 6, 12, and 18.*(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 4 times per day, at midnight, 6 AM, noon, and 6 PM. The six-hour schedule is a popular choice for tasks that need to run multiple times daily but where hourly execution would be wasteful. It effectively splits the day into four quarters, making it easy to reason about execution timing and log analysis. This frequency is often used for DNS record refreshes and SSL certificate checks. 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
Ideal for checking SSL certificate expiration dates across all your domains and sending alerts when certificates are nearing renewal time.
Try It — Interactive Builder
Every 6 hours
Next 10 Executions
Ctrl+Shift+C to copy expression