With cron, if I wanted to run a command every 5 mins it would be:
*/5 * * * * command
But what if I wanted to set a list of minutes specifically?
Like at 5 past, 18 mins past and 15 minutes too the hour? I'm guessing this:
5,18,45 * * * *
basic 3. /usr/bin/vim. tiny 4. /bin/ed Choose 1-4 [1]: 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.
Cron only allows for a minimum of one minute. What you could do is write a shell script with an infinite loop that runs your task, and then sleeps for 5 seconds. That way your task would be run more or less every 5 seconds, depending on how long the task itself takes.
Yes, the solution you specified is correct.
0,5,55 * * * * command # run the command at the top of the hour, at # the 5 minute mark and at the 55 minute mark.
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