How to use the Cron Job Every 5 Minutes
- Copy
*/5 * * * *and put your command after it in your crontab (open it withcrontab -e). - Check the next run times below, in UTC or your server's time zone.
- Need something slightly different? Edit any field and the description updates as you type.
The crontab line
*/5 * * * * /path/to/your-script.sh >> /var/log/your-script.log 2>&1
The five fields are minute, hour, day of month, month and day of week. Redirecting output to a log file (>> … 2>&1) keeps errors you'd otherwise never see.
Good for
- Syncing data or refreshing caches
- Sending queued emails or notifications
- Checking whether a website is up
Variations
1-59/5 * * * * | Every 5 minutes, starting at minute 1 (spreads load away from :00) |
*/5 9-17 * * 1-5 | Every 5 minutes during office hours on weekdays |
0,5,10,15,20,25,30,35,40,45,50,55 * * * * | The same as */5, written out |
Same schedule elsewhere
| GitHub Actions | on: schedule: - cron: '*/5 * * * *' (always UTC) |
|---|---|
| Kubernetes | spec.schedule: "*/5 * * * *" in a CronJob |
| Vercel | "crons": [{"path": "/api/job", "schedule": "*/5 * * * *"}] in vercel.json |
Frequently asked questions
Does */5 start when I save the crontab?
No. It runs on the clock's 5-minute marks (:00, :05, :10 …), not 5 minutes after you save.
Is GitHub Actions every 5 minutes reliable?
5 minutes is the shortest schedule GitHub allows, and runs are often delayed when GitHub is busy, so don't rely on exact timing.
What time zone does it use?
The time zone of the machine or service running cron, which is usually UTC on servers and cloud schedulers. GitHub Actions always uses UTC.