To run a cron job every 2 hours, on the hour, use:
0 */2 * * *
It fires at 00:00, 02:00, 04:00 and every even hour up to 22:00: 12 times a day. In a crontab:
0 */2 * * * /usr/local/bin/refresh-cache.sh >> /var/log/refresh-cache.log 2>&1
What each field means
| Field | Value | Meaning |
|---|---|---|
| Minute | 0 | at minute 0 |
| Hour | */2 | every 2nd hour, starting at 0 |
| Day of month | * | every day |
| Month | * | every month |
| Day of week | * | every day of the week |
Variants
| Schedule | Expression |
|---|---|
| Every 2 hours, written out | 0 0,2,4,6,8,10,12,14,16,18,20,22 * * * |
| Every 2 hours on odd hours | 0 1-23/2 * * * |
| Every 2 hours at :30 | 30 */2 * * * |
| Every 2 hours, 8:00 to 18:00 on weekdays | 0 8-18/2 * * 1-5 |
| Jenkins, spread | H H/2 * * * |
| Jenkins, weekday working hours | H H(8-15)/2 * * 1-5 |
| Quartz (seconds first) | 0 0 0/2 * * ? |
Spring @Scheduled | 0 0 */2 * * * |
| AWS EventBridge | rate(2 hours) or cron(0 0/2 * * ? *) |
Platform notes
- Linux crontab: even hours in the server's local time zone.
- GitHub Actions: UTC by default; add
timezone: "America/New_York"(any IANA name) under the cron entry to schedule in local time. Prefer a minute other than 0, such as23 */2 * * *, since the top of the hour is when delays are most likely. See GitHub Actions cron. - Kubernetes CronJob:
schedule: "0 */2 * * *"with.spec.timeZoneif the hours matter. - Cloudflare Cron Triggers: UTC. A trigger that runs every hour or less often gets up to 15 minutes of CPU time on the Paid plan (as of October 2026).
- Vercel: Pro or Enterprise only.
- Jenkins:
H H/2 * * *picks a stable minute and an hourly offset per job, so many jobs don't all start at the same moment. See Jenkins cron.
Common mistakes
- *` /2 * `* runs every minute of every even hour, 720 times a day.
- Steps that don't divide 24.
0 */5 * * *runs at 0, 5, 10, 15 and 20, then 0 again the next day: the last gap is 4 hours, because steps restart each day. - Forgetting UTC. A job meant for 8:00 local may land at 9:00 or 7:00 in a cloud scheduler.
Running an AI agent every 2 hours
A sensible pace for an agent that keeps a list fresh through the day, such as open support tickets or stale pull requests. The scheduled skills page shows how to run a Claude Code or Codex skill on any of these schedules.
Questions
Why does * */2 * * * run so often?
The * in the minute field means every minute, so it runs 60 times in each even hour. Put a single minute first: 0 */2 * * *.
How do I run every 2 hours on odd hours?
Use 0 1-23/2 * * * for 01:00, 03:00 and so on up to 23:00. The step counts from the start of the range, so starting the range at 1 shifts every run by an hour.
How do I run every 2 hours during working hours only?
Use 0 8-18/2 * * 1-5 for 8:00, 10:00, 12:00, 14:00, 16:00 and 18:00 on weekdays.
Does every 2 hours follow my time zone?
On a Linux server it follows the machine's time zone. GitHub Actions, Cloudflare and Vercel use UTC by default, so 0 */2 runs at even hours UTC, which may be odd hours where you are.