Tutorial

Run a cron job every 5 minutes.

Use */5 * * * * in your crontab. The */5 in the minute field means "every 5 minutes starting at 0" — so the job fires at :00, :05, :10, :15, all the way to :55 of every hour.

The expression

*/5 * * * * /path/to/your/script.sh

Reading left to right: every 5th minute, every hour, every day, every month, every weekday. That's 288 runs per day, or 8,640 per month.

Platform-specific examples

Linux crontab

*/5 * * * * /usr/local/bin/sync-data.sh

Add this line via crontab -e. Output goes to email by default — redirect to a log:

*/5 * * * * /usr/local/bin/sync-data.sh >> /var/log/sync.log 2>&1

AWS EventBridge

cron(*/5 * ? * * *)

AWS requires the question-mark placeholder for one of the day fields. See our AWS tool.

GitHub Actions

GitHub Actions enforces a 5-minute minimum, so this is the most frequent schedule allowed:

on:
  schedule:
    - cron: '*/5 * * * *'

In practice, GitHub may run the job slightly late (sometimes by 10-20 minutes) during peak load.

Kubernetes CronJob

apiVersion: batch/v1
kind: CronJob
metadata:
  name: every-5-min
spec:
  schedule: "*/5 * * * *"
  jobTemplate:
    spec: ...

Common variations

ExpressionMeaning
*/5 * * * *Every 5 minutes
*/5 9-17 * * 1-5Every 5 min, weekdays 9 AM-5 PM
0,5,10,15,20,25,30,35,40,45,50,55 * * * *Same as */5 (explicit form)
2-59/5 * * * *Every 5 min starting at :02 (offset to avoid stampedes)

Gotchas

  • Watch for overlapping runs. If your script takes more than 5 minutes, two instances will run concurrently. Use flock -n to prevent this — see our scheduling best practices.
  • Stampedes. If many servers all run */5 * * * *, they all fire at :00, :05, :10. Stagger with a random sleep at the start of the script, or use a different offset (e.g., 2-59/5).
  • GitHub Actions delays. Don't depend on exact 5-minute precision in GitHub Actions — schedule-triggered workflows can queue.

To verify your expression, paste it into the explainer and check the next 5 run times.

Related

Continue reading.