/

Cron: Every 45 Minutes

*/45 * * * * is one of cron's most common traps: because 45 doesn't divide evenly into 60, the step syntax doesn't produce a rolling 45-minute interval. It only expands to minutes 0 and 45 — so the gap alternates between 45 minutes (0 → 45) and 15 minutes (45 → the next hour's 0), not a consistent 45-minute cadence.

*/45 * * * *

Examples & Variations

*/45 * * * *

Fires at :00 and :45 — NOT evenly spaced

Try it

0 */1 * * *

True even interval alternative: hourly

Try it

*/15 * * * *

True even interval alternative: every 15 minutes

Try it

Common Mistakes

  • Assuming */45 behaves like */5 or */15 — step values only produce evenly-spaced results when the step evenly divides the field's range (60 for minutes). 45 does not divide 60, so the pattern breaks after the first hour.
  • Not noticing the alternating 45/15-minute gap in monitoring output, which can look like a flaky job when it's actually cron behaving exactly as specified.
  • Trying to fix it with a 6-field seconds-based expression — the same divisibility problem applies at any field, not just minutes.

Best Practices

  • For a genuinely rolling N-minute interval, only use step values where N evenly divides 60 (1, 2, 3, 4, 5, 6, 10, 12, 15, 20, 30) or 24 for hours (1, 2, 3, 4, 6, 8, 12).
  • If you specifically need 45-minute spacing, implement it in application code — have the job re-schedule its own next run 45 minutes out — rather than relying on cron's field syntax.
  • Document the alternating-gap behavior explicitly if you intentionally keep */45 for a non-critical task, so the next engineer doesn't 'fix' it into something else.

Frequently Asked Questions

Why doesn't */45 run every 45 minutes?
Cron step values expand within a field's fixed range by repeatedly adding the step from the minimum — for minutes, that's 0 to 59. Starting at 0 and adding 45 gives 0, 45, then 90, which is out of range and dropped, leaving only {0, 45}. It's not a rolling window, it's two fixed minutes per hour.
What cron expression actually gives evenly-spaced 45-minute runs?
None — standard cron can't express it, because 45 doesn't evenly divide 60. The only way to get a true rolling 45-minute cadence is to handle the scheduling in application code instead of a single cron field.
Are there other step values with this same problem?
Yes — any step that doesn't evenly divide the field's range behaves the same way. In the minute field (0–59), steps like 7, 8, 9, 11, 13, 14, and 45 all produce uneven gaps rather than a true rolling interval.