Cron Every 5 Minutes: The Exact Line, and the Trap to Avoid

If you want a job to run every five minutes, the line you need is:

*/5 * * * *

That is the whole schedule. Five fields, one line. Here is what each field means, what the line really promises — and the one thing that turns a working schedule into a mess.

The five fields, left to right

  • Minute — */5: every fifth minute: 00, 05, 10, 15, up to 55.
  • Hour — *: every hour.
  • Day of month — *: every day.
  • Month — *: every month.
  • Day of week — *: any day.

The */5 is shorthand for “start at the first value, then repeat every five.” So plain */5 starts work at :00. If you want an offset — say :02 — write 2-59/5 instead.

The trap: a job that takes longer than five minutes

Cron keeps its promise no matter what. Every five minutes it starts a new run, even when the previous one is still busy.

That is how you get two copies of a sync script touching the same files, the same queue item processed twice, or dozens of stale processes stacked at 3 a.m. The schedule is doing exactly what it says. The problem is that “start something every five minutes” and “do something every five minutes” are different promises.

Two honest fixes:

  1. Make the job safe to overlap. A lock file, or a tool flag that refuses to start twice, turns the overlap into a no-op.
  2. Slow the schedule down. If the job usually takes ten to twenty minutes, every five minutes was never going to work. Pick an interval that leaves the job room to breathe.

If the job is short and overlap is harmless, an offset like 2-59/5 * * * * is also a polite thing to do on a shared server — you stop starting work at the same moment as everyone else’s midnight chores.

When every five minutes is right

  • Refreshing a small dashboard or status page.
  • Checking a mailbox, queue, or folder for new items.
  • Any small, fast, boring job where a few minutes of latency costs nothing.

If the job is heavy, writes to shared state, or calls a rate-limited API, five minutes is usually too eager. Every fifteen minutes is often just as good and far quieter.

Check the line before it bites

Paste */5 * * * * into the parser and it reads back in plain English — field by field, with a warning if anything does not mean what it looks like. The exact schedule also has its own ready-made page: every 5 minutes, in full. And if your server runs systemd timers instead of cron, the converter translates between crontab and OnCalendar without surprises.

Every five minutes is a fine default for small jobs. Just keep the job smaller than the interval.