0 */6 * * *Fields
| Minute | 0 | 0 |
|---|---|---|
| Hour | */6 | 0, 6, 12, 18 |
| Day of month | * | any |
| Month | * | any |
| Day of week | * | any |
Where to use it
| crontab | 0 */6 * * * /path/to/script.sh |
|---|---|
| GitHub Actions | - cron: "0 */6 * * *" (on.schedule) |
| Kubernetes CronJob | schedule: "0 */6 * * *" |
crontab runs in the server’s time zone; GitHub Actions always uses UTC.
Good to know
0 */6 * * * runs at 00:00, 06:00, 12:00 and 18:00 server time. The step is anchored at midnight, not at the moment you installed the job; to run at 03:00, 09:00, 15:00 and 21:00, write 0 3-23/6 * * * or 0 3,9,15,21 * * *. Every 12 hours is 0 */12 * * *, giving midnight and noon, and every 4 hours is 0 */4 * * *.
These are fixed local hours, so daylight saving shifts them against UTC: on the spring change only 5 real hours pass between the 00:00 and 06:00 runs, and in autumn 7. If exact intervals matter, run the server in UTC or use a cron that supports CRON_TZ, such as cronie. Long backups at these times need flock -n and output appended to a log.