Every 5 minutes with Cron Studio
The expression opens as */5 * * * *, the standard "every 5 minutes" schedule. Below it you can see the next run times, change the time zone, and copy it for crontab, Kubernetes, GitHub Actions or systemd.
- Read the plain-English line and check the next runs: they should land on :00, :05, :10 and so on.
- Pick the time zone your server uses; every-5-minutes is the same in any zone, but the UTC column helps when you compare logs.
- Copy the crontab line and replace /path/to/command with your script.
- Add flock -n /tmp/job.lock in front of the command if a run can take longer than 5 minutes.
What to know
*/5 means "every minute whose number is divisible by 5", so the job fires at :00, :05, :10 and so on, regardless of when you installed it. It does not mean five minutes after the previous run finished. If one run takes seven minutes, the next starts while it is still working, and two copies write to the same files or hit the same API.
The fix is a lock. Prefix the command with flock -n /tmp/myjob.lock so a second copy exits immediately when the first still holds the lock, or have the script check a pid file. Also redirect output (>> /var/log/job.log 2>&1): without it, every run that prints something creates a local mail message that nobody reads.
On GitHub Actions the shortest allowed interval is 5 minutes, and scheduled runs are often delayed at busy times, so "every 5 minutes" can mean every 7 to 15. If minute-level precision matters, run the job on your own server or in a Kubernetes CronJob instead.
Updated · Cosmovex
Questions
What is the cron expression for every 5 minutes?
*/5 * * * * in the usual five-field format. In Quartz or Spring, which have a seconds field, use 0 */5 * * * ?. In AWS EventBridge use cron(0/5 * * * ? *) or rate(5 minutes).
Why does my every-5-minutes cron job run twice at once?
A run took longer than 5 minutes, so the next one started on top of it. Cron never waits for the previous run. Wrap the command in flock -n /tmp/job.lock so overlapping copies exit instead of running together.
Can cron run every 30 seconds?
Not in standard cron: the smallest unit is one minute. Quartz and Spring support a seconds field (*/30 * * * * ?). On a plain crontab, run a script every minute that does the work, sleeps 30 seconds and does it again.
Does */5 start counting from when I add it?
No. It matches the clock, so the first run is at the next minute that is a multiple of 5, whatever time you saved the crontab.
The free plan covers everything on this page. Cron Studio Pro ($19, paid once) is described on the Cron Studio page.