LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   CentOS 6.2 - where's cron.daily? (https://www.linuxquestions.org/questions/linux-server-73/centos-6-2-wheres-cron-daily-937066/)

fantasygoat 03-29-2012 06:47 AM

CentOS 6.2 - where's cron.daily?
 
For whatever reason, on most Linux distros cron.daily is run at 3-4am. Generally I move it back to midnight, but on CentOS 6.2 I cannot for the life of me figure out where it's configured!

The /etc/crontab does not have cron.daily listed, and grepping for it in /etc returns no useful results.

Where can I find the cron config for it?

MensaWater 03-29-2012 07:05 AM

On RHEL6 from which CentOS 6 is derived /etc/cron.daily is a directory like it was on RHEL5 and CentOS5.

fantasygoat 03-29-2012 07:20 AM

Yes, but I want to change WHEN cron.daily is run. It used to be in /etc/crontab but it's not there anymore.

MensaWater 03-29-2012 07:38 AM

Sorry

It appears they made a change in 6 so that daily, hourly, weekly etc... are run in anacron rather than cron so as to avoid conflict with cron. The file you need is /etc/anacrontab

I figured this out by reviewing /etc/crontab which gave standard crontab line (as used in user crontabs that is) examples but was otherwise empty. It noted:
Quote:

# For details see man 4 crontabs
Typing "man 4 crontabs" gave the man page which says in part:
Quote:

Historically the crontab file contained configuration which called run-parts on files in cron.{daily,weekly,monthly} directories. These jobs are now run indirectly through anacron to prevent conflicts between cron and anacron. That means the anacron package has to be installed if the jobs in these directories should be running. Refer to the anacron(8) how to limit the time of day of the job execution.
Typing "man anacron" gave the man page which says in part:
Quote:

Anacron reads a list of jobs from a configuration file, /etc/anacrontab (see anacrontab(5)). This file contains the list of jobs that Anacron controls. Each job entry specifies a period in days, a delay in minutes, a unique job dentifier, and a shell command.
When I looked at /etc/anacrontab I saw at the end of the file:
Code:

#period in days  delay in minutes  job-identifier  command
1      5      cron.daily              nice run-parts /etc/cron.daily
7      25      cron.weekly            nice run-parts /etc/cron.weekly
@monthly 45    cron.monthly            nice run-parts /etc/cron.monthly


fantasygoat 03-29-2012 08:19 AM

Based on your info, I discovered that you need to add "cronie-noanacron" and erase "cronie-anacron" to get the old behavior of setting cron.daily start times.

Thanks!


All times are GMT -5. The time now is 09:10 PM.