[CentOS] crontab and/or anacrontab ?

Thu Mar 11 14:20:26 UTC 2010
Alexander Dalloz <ad+lists at uni-x.org>


> Sorry, it's not at all clear to me.
> The machine in question is running all the time.
> Are you saying that anacron should be turned off in this case,
> presumably by "chkconfig anacron off"?
>
> 1) I didn't turn it on, so presumably anacron runs by default under
> CentOS.
>
> 2) As far as I can tell, the duplication only started recently,
> when I noticed that I was getting logwatch messages twice a day.
>
> I have another CentOS-5.4 machine, which is also running all the time,
> and as far as I can see there is no duplication on that machine.
>
> To repeat my question, is one meant to turn anacron off
> if the machine is running all the time?
> Or is anacron meant to determine this in some way?
> And if so, how?

> Timothy Murphy

Hi Timothy,

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

There is no need to deactivate or remove anacron. If your system runs all
the time, then anacron will not come into play. If you got actions by
anacron on one of your systems, then it either was off while cronjobs
should have run or it was in single user mode.

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.

Regards

Alexander