[CentOS] crontab and/or anacrontab ?

Robert Nichols rnicholsNOSPAM at comcast.net
Thu Mar 11 22:50:04 UTC 2010


On 03/11/2010 10:17 AM, 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.

In that case feel free to disable anacron, but it really makes little
difference.  As Stephen has pointed out, in CentOS 5 anacron runs once
when you enter any of the runlevels where it is active, runs any
overdue {daily,weekly,monthly} jobs, and then exits.  If there are no
overdue jobs, anacron exits immediately.

BTW, don't try to apply this knowledge to more recent releases, such
as Fedora 12.  There, the interaction between cron and anacron is
more complex.  The standard setup there is for cron to run only the
hourly jobs and for anacron, started each hour as one of those jobs,
to run any needed {daily,weekly,monthly} jobs.

-- 
Bob Nichols     "NOSPAM" is really part of my email address.
                 Do NOT delete it.




More information about the CentOS mailing list