*/5 in a crontab is every five minutes on the clock. The full line is */5 * * * *. It runs at minute 0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, and 55 of every hour. The step starts at 0. Twelve starts an hour.
Build the five fields in the cron expression generator. The page does not install the job. Copy the line into the crontab on the host that will run it.
Locked to the clock
*/5 does not mean five minutes after you save the crontab. Install the line at 10:03 and the next run is 10:05, then 10:10. The schedule does not remember the minute you edited the file.
*/5 * * * * # 0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55
*/10 * * * * # 0, 10, 20, 30, 40, 50
*/15 * * * * # 0, 15, 30, 45
*/30 * * * * # 0 and 30
Each of those forms includes minute 0. 5-59/5 * * * * is different: the range starts at 5, so the top of the hour is skipped. Use that only when you want minute 0 quiet. For a plain every-five-minutes job, keep */5 * * * *.
Five fields, no seconds
A standard crontab line has five time fields, then the command: minute, hour, day of month, month, and day of week. There is no seconds field. The daemon starts the command once when the minute begins. It does not fire again at second 10 or 20 inside that minute.
Do not paste a Quartz or EventBridge line into a five-field crontab. Quartz puts seconds first. EventBridge uses six fields and ? in a day field. A five-field line from this site matches neither shape.
One cycle on the host
*/5 * * * * date >> /tmp/cron-every-5.log
Wait for two lines five minutes apart, then remove the test. Call real programs by absolute path. Cron's PATH is often shorter than a login shell.
Top comments (0)