Cron expression for every 8 hours
0 */8 * * *Every 8 hours, on the hour.
Runs three times a day at 00:00, 08:00 and 16:00.
Try it and tweak it
Change any field below and the preview updates. Set the time zone to match your server.
✓ Valid cron
Every 8 hours, on the hour.
Next 10 runs
Calculating in your browser…
Times are computed in your browser for the selected zone and are informational. The server that runs the job uses its own zone (often UTC) and cron flavour, so verify there.
Same schedule in other dialects
Unix crontab
0 */8 * * *Quartz
0 0 */8 * * ?Spring @Scheduled
0 0 */8 * * ?AWS EventBridge
cron(0 */8 * * ? *)Add it to your crontab
- Open your crontab with
crontab -e. - Add one line:
0 */8 * * * /full/path/to/command >> /var/log/job.log 2>&1 - Save and exit. Cron reloads automatically; confirm with
crontab -l.
Need the output silenced, a lock against overlapping runs or a system crontab user column? The generator’s full crontab line builder writes it for you. Already have a crontab? Paste it into the crontab parser to check every job.
Variations
0 6,14,22 * * * | Every 8 hours aligned to shift changes |
In other schedulers
| crontab line | 0 */8 * * * /path/to/command |
| Quartz | 0 0 */8 * * ? |
| Spring | @Scheduled(cron = "0 0 */8 * * ?") |
| AWS EventBridge | cron(0 */8 * * ? *) |
| GitHub Actions | - cron: '0 */8 * * *' (UTC) |
| Kubernetes | schedule: "0 */8 * * *" |
Questions
What is the cron expression for every 8 hours?
0 */8 * * *. Every 8 hours, on the hour.
How do I write it in Quartz or Spring?
Add a seconds field and use "?" for the unused day field: 0 0 */8 * * ?. In Spring: @Scheduled(cron = "0 0 */8 * * ?").
What is the AWS EventBridge version?
cron(0 */8 * * ? *). AWS uses six fields with a year at the end and needs "?" in one of the day fields.
How do I set up a cron job to run every 8 hours?
Run crontab -e, add the line "0 */8 * * * /full/path/to/command >> /var/log/job.log 2>&1" and save. Use absolute paths, because cron runs with a minimal PATH. Check it with crontab -l.
What does the / in 0 */8 * * * mean?
The slash is a step value: */N means every Nth value counted from the start of the field (0 for minutes and hours, 1 for days and months), not from when the job was created.
Which time zone will it use?
The time zone of the machine or service running cron. GitHub Actions and Vercel use UTC; Kubernetes uses spec.timeZone if set. The preview above lets you pick a zone.