How can I set cron to run certain commands every one and a half hours?
Show activity on this post. ->cron('0 */12 * * *'); This cron will run the scheduler at every 12 hours.
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.
That's not possible with a single expression in normal cron
.
The best you could do without modifying the code is:
0 0,3,6,9,12,15,18,21 * * * [cmd] 30 1,4,7,10,13,16,19,22 * * * [cmd]
These might be compressible, depending on the version of cron you have to:
0 */3 * * * [cmd] 30 1-23/3 * * * [cmd]
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