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 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

Specifying “all odd values” in crontab?

Depending on your version of cron, you should be able to do (for hours, say): 1-23/2 Going by the EXTENSIONS section in the crontab(5) manpage: Ranges can include “steps”, so “1-9/2” is the same as “1,3,5,7,9”. For a more portable solution, I suspect you just have to use the simple list: 1,3,5,7,9,11,13,15,17,19,21,23 But it might … Read more

Cron job every three days

Run it every three days… 0 0 */3 * * How about that? If you want it to run on specific days of the month, like the 1st, 4th, 7th, etc… then you can just have a conditional in your script that checks for the current day of the month. if (((date(‘j’) – 1) % … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)