Variables in crontab?

In Vixie cron, which is possibly the most common, you can do this almost exactly like a shell script. VARIABLE=value PATH=/bin:/path/to/doathing 0 0 * * * doathing.sh $VARIABLE The man page says: An active line in a crontab will be either an environment setting or a cron command. An environment setting is of the form, … Read more

How does cron internally schedule jobs?

A few crickets heard in this question. Good ‘ol RTFC with some discrete event simulation papers and Wikipedia: http://en.wikipedia.org/wiki/Cron#Multi-user_capability The algorithm used by this cron is as follows: On start-up, look for a file named .crontab in the home directories of all account holders. For each crontab file found, determine the next time in the … Read more

How to set a cron job to run at a exact time?

You can also specify the exact values for each gr 0 2,10,12,14,16,18,20 * * * It stands for 2h00, 10h00, 12h00 and so on, till 20h00. From the above answer, we have: The comma, “,”, means “and”. If you are confused by the above line, remember that spaces are the field separators, not commas. And … Read more

How to install crontab on Centos

As seen in Install crontab on CentOS, the crontab package in CentOS is vixie-cron. Hence, do install it with: yum install vixie-cron And then start it with: service crond start To make it persistent, so that it starts on boot, use: chkconfig crond on On CentOS 7 you need to use cronie: yum install cronie … Read more