[CentOS] crontab and/or anacrontab ?

Thu Mar 11 13:02:50 UTC 2010
Alexander Dalloz <ad+lists at uni-x.org>

> Is one meant to have one or the other?
> If so, which is recommended?
> I have
> --------------------------------
> [tim at helen etc]$ cat anacrontab

[ ... ]

> [tim at helen etc]$ cat crontab

[ ... ]

> I didn't write either of these,
> they must have been automatically installed.
>
> My impression is that anacrontab was ignored until recently,
> but now as far as I can see both are being read and acted on.
>
> Any enlightenment gratefully received.

> Timothy Murphy

It is pretty "normal" to have them both on CentOS.

# rpm -qf /etc/crontab
crontabs-1.10-8
# rpm -qf /etc/anacrontab
anacron-2.3-45.el5

man 8 anacron

"DESCRIPTION
       Anacron  can  be  used  to  execute  commands  periodically, with a
frequency specified in days. Unlike cron(8), it does not assume
that the machine is running continuously.  Hence, it  can  be used 
on machines that aren’t running 24 hours a day, to control daily,
weekly, and monthly jobs that are usually controlled by cron."

This should make obvious why there are both of the crontabs and in which
situations anacron runs through his tab and when cron runs through his.

Regards

Alexander