Go back to the main page

Cron time ranges

This article is over 2 years old. Proceed with caution.

Regards ♨ – Minimul

 

Let's say you wanted a task to only run every 4 minutes from time ranges of 6PM to 1AM and 3AM to 7AM. Just do the following:

# /etc/crontab
*/4 18-1,3-7 * * * root eval "$lynx/library/mysql.batch.php?runQuery=e > /tmp/www_dir/cp/dims/${c_date}_lumber_archive.html"

Right? Wrong. It is has to be done in 3 parts like so:

*/4 18-23,0-1,3-7 * * * root eval "$lynx/library/mysql.batch.php?runQuery=e > /tmp/www_dir/cp/dims/${c_date}_lumber_archive.html"
Comment on this article?