Completely disable anacron but leave cron on.

General support questions
User avatar
AlanBartlett
Forum Moderator
Posts: 9345
Joined: 2007/10/22 11:30:09
Location: ~/Earth/UK/England/Suffolk
Contact:

Re: Completely disable anacron but leave cron on.

Post by AlanBartlett » 2011/07/29 16:47:48

So here's an experiment for you --

[code]
Add a line that reads "[i]exclude = cronie-anacron[/i]" to your [b]/etc/yum.conf[/b] file.
Remove the [i]cronie-anacron[/i] package: [b]rpm -e --nodeps cronie-anacron[/b]
[/code]
Remember the golden rule -- if you break your system, you get to keep all the pieces! ;-)

sblantipodi
Posts: 252
Joined: 2009/07/10 09:43:13
Contact:

Re: Completely disable anacron but leave cron on.

Post by sblantipodi » 2011/07/29 17:36:02

as someone saied anacron doesn't execute jobs in cron.hourly, so why my cron.hourly is executed two times every hour?

gerald_clark
Posts: 10642
Joined: 2005/08/05 15:19:54
Location: Northern Illinois, USA

Completely disable anacron but leave cron on.

Post by gerald_clark » 2011/07/29 18:07:26

There are 3 cronie packages.
cronie
cronie-anacron
cronie-noanacron

cronie-anacron does include /etc/cron.hourly/0anacron

Perhaps you want to install cronie-noanacron instead of cronie-anacron.

gulikoza
Posts: 188
Joined: 2007/05/06 20:15:23

Re: Completely disable anacron but leave cron on.

Post by gulikoza » 2011/07/29 19:25:34

Now I get it. Cronie package by itself does not execute cron.daily, weekly&monthly scripts.../etc/crontab is empty. Scripts are executed either by anacron or /etc/cron.d/dailyjobs (cronie-noanacron) so cronie package depends on either cronie-anacron or cronie-noanacron to actually function as crond did.
Installing cronie-noanacron will enable uninstalling cronie-anacron without breaking dependencies.

sblantipodi
Posts: 252
Joined: 2009/07/10 09:43:13
Contact:

Re: Completely disable anacron but leave cron on.

Post by sblantipodi » 2011/07/29 19:39:59

[quote]
gulikoza wrote:
Now I get it. Cronie package by itself does not execute cron.daily, weekly&monthly scripts.../etc/crontab is empty. Scripts are executed either by anacron or /etc/cron.d/dailyjobs (cronie-noanacron) so cronie package depends on either cronie-anacron or cronie-noanacron to actually function as crond did.
Installing cronie-noanacron will enable uninstalling cronie-anacron without breaking dependencies.[/quote]

where do you read that cronie-noanacron equals to uninstall anacron?

gulikoza
Posts: 188
Joined: 2007/05/06 20:15:23

Re: Completely disable anacron but leave cron on.

Post by gulikoza » 2011/07/29 22:46:16

It does not equal uninstalling...actually cronie-noanacron is not active if /etc/cron.hourly/0anacron exists. But after installing it, you can safely uninstall cronie-anacron without breaking rpm dependencies.

User avatar
AlanBartlett
Forum Moderator
Posts: 9345
Joined: 2007/10/22 11:30:09
Location: ~/Earth/UK/England/Suffolk
Contact:

Re: Completely disable anacron but leave cron on.

Post by AlanBartlett » 2011/07/29 23:31:53

To illustrate what [b]gulikoza[/b] has written, the following command sequence should be appropriate --

[code]
[b]sudo yum install cronie-noanacron
sudo yum remove cronie-anacron[/b]
[/code]

sblantipodi
Posts: 252
Joined: 2009/07/10 09:43:13
Contact:

Re: Completely disable anacron but leave cron on.

Post by sblantipodi » 2011/07/30 00:02:51

ok, disintalled the anacron but cron.hourly is executed two times every hour and I cannot understand why.

this is my crontab

[code]
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/

# For details see man 4 crontabs

# Example of job definition:
# .---------------- minute (0 - 59)
# | .------------- hour (0 - 23)
# | | .---------- day of month (1 - 31)
# | | | .------- month (1 - 12) OR jan,feb,mar,apr ...
# | | | | .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
# | | | | |
# * * * * * command to be executed

# run-parts
01 * * * * root run-parts /etc/cron.hourly
02 4 * * * root run-parts /etc/cron.daily
22 4 * * 0 root run-parts /etc/cron.weekly
42 4 1 * * root run-parts /etc/cron.monthly
[/code]
any idea?

sblantipodi
Posts: 252
Joined: 2009/07/10 09:43:13
Contact:

Re: Completely disable anacron but leave cron on.

Post by sblantipodi » 2011/07/30 09:14:59

the funny thing is that after installed cronie-noanacron and removed anacron
also cron.daily is executed two times.

One with this:
Cron run-parts /etc/cron.daily

and one with this:
Cron [ ! -f /etc/cron.hourly/0anacron ] && run-parts /etc/cron.daily

gulikoza
Posts: 188
Joined: 2007/05/06 20:15:23

Re: Completely disable anacron but leave cron on.

Post by gulikoza » 2011/07/30 09:37:09

/etc/crontab file does not contain run-parts on my system. You must have added that yourself. That is probably also the reason why cron.hourly is run twice.
On a clean Centos6, /etc/crontab will be empty, cron.hourly is executed by /etc/cron.d/0hourly and cron.daily, monthly and weekly are executed by either anacron (if cronie-anacron is installed) or /etc/cron.d/dailyjobs (if cronie-noanacron is used).

Post Reply