On Thursday 11 March 2010 16:17:13 Timothy Murphy wrote:
Alexander Dalloz wrote:
let's take the case that you have a power failure or a scheduled maintenance with your system for instance in the early morning hours, from 03:00am - 05:00am. cron.daily is set by default to run at 04:02am. So in this case cron could not perform tasks like logwatch. logwatch will miss in such a case, *if* there wouldn't be anacron which takes over the task to run after the machine is up again (i.e. at 05:00am).
Thanks for your response.
Actually, I wouldn't mind in the slightest if cron.daily failed to run because the machine was down at the nominated time. It is not as though my world depends on cron.daily running every day. I certainly would not run another program in case that happened.
You're world may not depend on it but those of us who run 10's of servers need a bit more reassurance. ;-)
How anacron handles jobs is documentend in "man 8 anacron". It uses timestamp files in /var/spool/anacron/ to control, when a job was last performed and whether it is pending.
Actually, "man 8 anacron" does not say that. It says "Anacron records the date in a special timestamp file", but it doesn't say where that file is.
They're in /var/spool/anacron. Three files cron.daily .weekly .monthly.
I see that there are actually files /var/spool/anacron/cron.daily , etc, on my machine listing the last day anacron ran (20100311) But it seems that this information is not used, in my case, I don't know why.
That's the date anacron was last run.
As I said, this duplication seems to have started recently, and I have taken no action on this machine for months apart from running "sudo yum update", so I assume some update had this effect.
Yum probaably updated anacron and set it to running
On my laptop
# rpm -qa --last | grep anacron gives cronie-anacron-1.4.3-4.fc12 Sat Feb 27 11:05:52 2010
So it was updated last on 27th Feb.
I have a second CentOS machine where this duplication does not occur, even though everything seems the same as on the first machine.
Tony