I would like to have a script run every 5 minutes let's say starting from 13:02 so I can have another script runs every 5 minutes but starting from 13:04 so the second script runs two minutes after the start of the first job. How can I achieve this?
Make a new line at the bottom of this file and insert the following code. Of course, replace our example script with the command or script you wish to execute, but keep the */5 * * * * part as that is what tells cron to execute our job every 5 minutes.
“At every 5th minute.” Cron job every 5 minutes is a commonly used cron schedule. We created Cronitor because cron itself can't alert you if your jobs fail or never start. Cronitor is easy to integrate and provides you with instant alerts when things go wrong.
Execute Cron Job After System Reboot. Setup and Run PHP Script As A Cron Job. Run crontab job every minute on a Linux or Unix-like system.
It is a wildcard for every part of the cron schedule expression. So * * * * * means every minute of every hour of every day of every month and every day of the week .
*/5+2 * * * * 1st-script */5+4 * * * * 2nd-script
For future reference take a look at this online Cron Job Generator.
Since there are several reports that the +
syntax is not working on Ubuntu 14.04, here's a variation:
2-59/5 * * * * 1st-script 4-59/5 * * * * 2nd-script
This will result in the 1st script to run every 5 minutes starting with an offset of 2 minutes at the beginning of each hour and the 2nd script to behave the same with an offset of 4 minutes.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With