o
Cronjob.de › Crontab reference › Every 5 minutes
The expression for "every five minutes" is */5 * * * *. It is the most common interval of all: often enough for scheduled tasks to be done on time, and rare enough not to burden any server.
Meaning
*/5 in the first field means: every minute divisible by five. The job therefore starts at minute 0, 5, 10, 15 and so on up to 55, which is twelve runs per hour and 288 per day. The other four fields are * and restrict nothing: every hour, every day, every month, every day of the week.
The difference from "five minutes after the last run" matters. Cron works with fixed clock times. If you set it up at 10:03, the first run is at 10:05, not at 10:08.
The next runs
Calculated in German time when this page was loaded.
Variants
*/5 8-18 * * * |
Every 5 minutes, but only from 8:00 to 18:55. | Adjust |
*/5 * * * 1-5 |
Every 5 minutes, Monday to Friday only. | Adjust |
*/10 * * * * |
Every 10 minutes, half as often. | Adjust |
*/15 * * * * |
Every 15 minutes, on the hour, quarter past, half past and quarter to. | Adjust |
2-57/5 * * * * |
Every 5 minutes, but offset by two minutes: 2, 7, 12 … This spreads the load when many jobs start on the five-minute mark. At Cronjob.de only from Plus, because the free plan runs on the five-minute grid. | Adjust |
Watch out for
5 * * * * is not "every 5 minutes"Without the slash, the 5 means "at minute 5". The job then runs only once an hour, at 0:05, 1:05, 2:05 and so on. That is the most common mistake with this interval.
Cron does not wait for the previous run to finish. If your script sometimes takes longer, two run at the same time and get in each other's way, for example when sending mails. A lock at the start of the script prevents this, for example a file created at the start and deleted at the end.
When a service calls your script through an address, it does not wait forever. At Cronjob.de it is 45 seconds on the free plan and 60 seconds on the paid ones. Larger work is best split up: one batch per call, run every five minutes.
Own server
Open with crontab -e and add one line. The first starts a PHP script directly, the second calls an address. Replace paths and address with your own.
*/5 * * * * /usr/bin/php /pfad/zu/skript.php >/dev/null 2>&1
*/5 * * * * curl -fsS https://ihre-domain.de/cron.php >/dev/null
Without your own server
No command-line access needed: you enter the address of your script and click the schedule together. You can also type the expression above directly, or describe the interval in one sentence and have it suggested. Cronjob.de uses German time.
Five cronjobs are free forever, on the five-minute grid. One-minute intervals start with Plus. How to prepare a script on shared web space for this is explained in the web space guide.
FAQ
Create an account, enter the address, click the schedule. Five cronjobs are free forever, the first 14 days run on the Unlimited plan.
Start for free To the crontab generatorMore schedules
Also useful