Run a cron job every 6 hours with 0 */6 * * *. Executes 4 times daily at 00:00, 06:00, 12:00, 18:00.
The cron expression 0 */6 * * * runs a command every 6 hours starting at midnight, producing 4 executions per day. It triggers at 00:00, 06:00, 12:00, 18:00 (midnight, 6 AM, noon, 6 PM) daily. The minute field (0) controls the offset within each hour. Common use cases include periodic data synchronization, database replication checks, system health reports, cache invalidation, and batch processing pipelines that don't require minute-level frequency. Running every 6 hours balances data freshness with system load. For Quartz Scheduler, use 0 0/6 * ? * * (7 fields, seconds first, ? for day-of-week). For AWS EventBridge, use rate(6 hours) or cron(0 0/6 ? * * *). For Kubernetes CronJob, use schedule: "0 */6 * * *" directly. Note that */6 in the hour field starts from hour 0 (midnight). If you need a different starting hour, use explicit values: for example, 0 2,8,14,20 * * * runs every 6 hours starting at 2 AM instead of midnight. If you want this schedule only on weekdays, add the day-of-week field: 0 */6 * * 1-5. For business-hours-only variations, use an hour range like 0 9-17 * * 1-5.
The expression 0 */6 * * * means: at minute 0, hour */6, day-of-month *, month *, day-of-week *. Each field in the cron expression controls a different time component: minute, hour, day of month, month, and day of week.
Run crontab -e in your terminal to open your crontab editor. Add a new line: 0 */6 * * * /path/to/your/script.sh. Save and exit. Verify with crontab -l. Make sure your script is executable (chmod +x script.sh) and uses full paths for all commands.
Quartz Scheduler: 0 */6 * * ?. AWS EventBridge: cron(0 */6 ? * * *). Kubernetes CronJob: schedule: "0 */6 * * *" (standard 5-field format). Each platform has slight syntax differences — use our dialect switcher above to get the exact expression.
Yes. */6 starts from hour 0 (midnight). To start from a different hour, use explicit comma-separated values. For example, to run every 6 hours starting at 3 AM: 0 3,9,15 * * *.
Common pitfalls: (1) Cron uses a minimal PATH — always use full paths to commands and scripts. (2) Percent signs (%) must be escaped with backslash in crontab. (3) Cron runs in the system timezone — set CRON_TZ=UTC at the top of your crontab for consistent UTC scheduling. (4) Redirect output to prevent email spam: 0 */6 * * * /path/command >> /var/log/myjob.log 2>&1. (5) Test your cron expression with crontab.guru or our validator above before deploying.
For a specific hour instead of interval: use comma-separated values like 0 0,8,16 * * *.
The cron expression 0 */6 * * * has different syntax on various scheduling platforms. Here is the equivalent expression for each:
| Platform | Expression |
|---|---|
| Unix / Linux crontab | 0 */6 * * * |
| Quartz Scheduler (Java) | 0 */6 * * ? |
| AWS EventBridge | cron(0 */6 ? * * *) |
| Kubernetes CronJob | 0 */6 * * * |
| Vercel Cron | 0 */6 * * * |
| GitHub Actions | 0 */6 * * * (UTC) |
Key differences across platforms: Quartz uses 7 fields starting with seconds and supports L (last) and W (weekday) modifiers. AWS EventBridge requires a 6th year field and uses ? instead of * in day fields when the other day field is specified. Kubernetes uses standard 5-field Unix cron. Vercel Cron uses the same format but schedules are defined in vercel.json. GitHub Actions uses standard cron but runs in UTC timezone only, so adjust the hour field for your local timezone offset.
Follow these tips when setting up cron jobs in production: