Cron: Every 2 Hours
0 */2 * * * fires twelve times a day, on the even hour — 00:00, 02:00, 04:00, and so on through 22:00. Since 2 evenly divides 24, this step value produces a genuinely consistent, rolling interval, unlike odd step values such as 45 minutes.
0 */2 * * *
Examples & Variations
Common Mistakes
- Assuming */2 in the hour field starts counting from deploy time — like all step values, it's anchored to hour 0 (midnight), not to whenever the cron entry was created.
- Using 2-hour polling for something that needs faster feedback — this interval suits periodic sync and light maintenance, not anything user-facing that needs near-real-time updates.
- Forgetting that 0 */2 * * * still fires overnight — add an hour range (like 8-20/2) if the job should only run during waking hours.
Best Practices
- This is a solid default for moderate-cost jobs that don't need hourly freshness — cache refreshes, periodic exports, or non-urgent sync tasks.
- Combine with an hour range to restrict to business hours if the job supports a feature nobody uses overnight.
- If two different jobs both run every 2 hours, offset one to odd hours (1-23/2) so they don't compete for the same resources simultaneously.
Frequently Asked Questions
- Does 0 */2 * * * run at exactly midnight?
- Yes — step values in the hour field start from 0, so */2 always includes hour 0 (midnight) as its first match, then every 2 hours after.
- How do I run every 2 hours starting from 1 AM instead?
- Use a range with a step: 0 1-23/2 * * * produces 1 AM, 3 AM, 5 AM, and so on — odd hours instead of even ones.
- Is every 2 hours a good interval for health checks?
- It's on the slower end for health checks — most uptime monitoring wants 1–5 minute intervals to catch outages quickly. Every 2 hours suits periodic maintenance more than availability monitoring.
Related Tools
Cron Parser
Translate cron expressions to plain English
Cron Cheat Sheet
Quick reference for cron syntax, special characters, and shortcuts
Cron Examples Library
Browse and search common cron expression examples
Cron: Every 45 Minutes
*/45 * * * * does NOT run every 45 minutes on a rolling basis — it only matches minutes 0 and 45. See why, and how to actually get even 45-minute spacing.
Cron: Every 3 Hours
The cron expression for every 3 hours is 0 */3 * * *, firing 8 times a day. See examples, mistakes, and best practices for this schedule.
Cron: Every 4 Hours
The cron expression for every 4 hours is 0 */4 * * *, firing 6 times a day. See examples, mistakes, and best practices for this schedule.