cron - how to give priority to a task running in cron.daily?
I have two custom tasks running daily. How do you give priority to one over the other?
One of them is configured via the logrotate.conf. The other sits directly in cron.daily.
The logrotate script checks for a certain file and:
create **** root utmp
file > /var/log/fileToWriteTo
chmod *** /var/log/fileToWriteTo
I'd like the one in cron.daily to run after the script that is in logrotate.
Please can you advise how to do this...
Many thanks in advance!
well, logrotate is also in cron.daily for me. So, name your script such that it comes alphabetically after logrotate.
logrotate is in cron.daily on my system, also. You could rename logrotate to "00-logrotate" and name your script to "01-my_script_name" and see if that works.
Ah. Ok - thank you.
I've had not seen your replies, so actually did it myself in a round about way (I think)
Basically created a new directory called scripts and then put the desired script in there.
Then, did a crontab -e
and appended to it:
0 7 * * * /pathToScript
When you do a crontab -l it comes up as above.
A bit more faff than what you've suggested,but will that work okay? (as in run daily at 7am?)
|All times are GMT -5. The time now is 05:20 PM.|