CentOS Icon CentOS Logo
CentOS Text
   
  
www.centos.org Forum Index
   CentOS 6 - General Support
  Completely disable anacron but leave cron on.

 

 Bottom   Previous Topic   Next Topic
12>
  •  Rate Thread
      Rate this Thread
      Excellent
      Good
      Average
      Bad
      Terrible
Poster Thread
  •  nospa1
      nospa1
Re: Completely disable anacron but leave cron on.
#25
Peeking in the Member Window
Joined: 2010/9/21
From
Posts: 17
Quote:

sblantipodi wrote:
ok the problem was that cron.hourly is scheduled by /etc/cron.d/0hourly and /etc/crontab,
fixed it, thanks.


Hi

Have you removed file /etc/cron.d/0hourly or rather you have removed cron.hourly from /etc/crontab?

If you have only removed entrie from /etc/crontab and left 0hourly - could you please post content of 0hourly ?
Posted on: 2012/1/21 9:46
Create PDF from Post Print
Top
  •  tdexter
      tdexter
Re: Completely disable anacron but leave cron on.
#24
Newbie
Joined: 2011/10/24
From
Posts: 2
Duh...never mind. Pilot error...

I'd apparently screwed up when changing times in dailyjobs and had left out one of the asterisks in the line for cron.daily.
Posted on: 2011/10/24 17:26
Create PDF from Post Print
Top
  •  tdexter
      tdexter
Re: Completely disable anacron but leave cron on.
#23
Newbie
Joined: 2011/10/24
From
Posts: 2
I'm attempting to disable anacron on a new CentOS 6 install as described in this thread. I've installed cronie-noanacron and removed cronie-anacron.

Just as I expected from what I've read here, /etc/cron.hourly/0anacron is no longer there and the install of cronie-noanacron added /etc/cron.d/dailyjobs.

After I did that I restarted crond. Last night none of the jobs in /etc/cron.daily ran. Is there something I'm missing here? Does something else need to be changed to make the steps defined in /etc/cron.d/dailyjobs run?

What confuses me more is the fact that the RHEL6 documentation says that if you remove cronie-anacron you can schedule jobs in crontab, which is quite different from anything described here. Is that actually the case in RHEL6 and not in CentOS 6? crontab is supposed to be empty correct?

I can't imagine what I'm missing.

Tom
Posted on: 2011/10/24 13:59
Create PDF from Post Print
Top
  •  sblantipodi
      sblantipodi
Re: Completely disable anacron but leave cron on.
#22
Regular Board Member
Joined: 2009/7/10
From
Posts: 149
ok the problem was that cron.hourly is scheduled by /etc/cron.d/0hourly and /etc/crontab,
fixed it, thanks.
Posted on: 2011/7/30 16:14
Create PDF from Post Print
Top
  •  gulikoza
      gulikoza
Re: Completely disable anacron but leave cron on.
#21
Regular Board Member
Joined: 2007/5/6
From
Posts: 87
One thing to note is that with default cronie-anacron installed, the system relies entirely on anacron and it's settings to run cron.daily, weekly and monthly scripts. Only cron.hourly is directly executed by crond. This is a difference from "classic" linux system where those scripts are executed from /etc/crontab. I assume this is because anacron adds a random delay and serializes job execution so that the scripts don't run at the same time. It would also be a mistake to forcefully remove anacron...

There's a lot of differences in how the system works in C6 (upstart instead of init and all the other differences...) so it will take some time to get used to doing things differently.
Posted on: 2011/7/30 10:11
Create PDF from Post Print
Top
  •  gulikoza
      gulikoza
Re: Completely disable anacron but leave cron on.
#20
Regular Board Member
Joined: 2007/5/6
From
Posts: 87
/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).
Posted on: 2011/7/30 9:37
Create PDF from Post Print
Top
  •  sblantipodi
      sblantipodi
Re: Completely disable anacron but leave cron on.
#19
Regular Board Member
Joined: 2009/7/10
From
Posts: 149
the funny thing is that after installed cronie-noanacron and removed anacron
also cron.daily is executed two times.

One with this:
Cron <root@hostname> run-parts /etc/cron.daily

and one with this:
Cron <root@hostname> [ ! -f /etc/cron.hourly/0anacron ] && run-parts /etc/cron.daily
Posted on: 2011/7/30 9:14
Create PDF from Post Print
Top
  •  sblantipodi
      sblantipodi
Re: Completely disable anacron but leave cron on.
#18
Regular Board Member
Joined: 2009/7/10
From
Posts: 149
ok, disintalled the anacron but cron.hourly is executed two times every hour and I cannot understand why.

this is my crontab

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

any idea?
Posted on: 2011/7/30 0:02
Create PDF from Post Print
Top
  •  AlanBartlett
      AlanBartlett
Re: Completely disable anacron but leave cron on.
#17
Moderator
Joined: 2007/10/22
From ~/Earth/UK/England/Suffolk
Posts: 9188
To illustrate what gulikoza has written, the following command sequence should be appropriate --

sudo yum install cronie-noanacron
sudo yum remove cronie-anacron
_________________
Alan

100% Unix & Linux. Co-founder of the ELRepo Project.
Posted on: 2011/7/29 23:31
Create PDF from Post Print
Top
  •  gulikoza
      gulikoza
Re: Completely disable anacron but leave cron on.
#16
Regular Board Member
Joined: 2007/5/6
From
Posts: 87
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.
Posted on: 2011/7/29 22:46
Create PDF from Post Print
Top
  •  sblantipodi
      sblantipodi
Re: Completely disable anacron but leave cron on.
#15
Regular Board Member
Joined: 2009/7/10
From
Posts: 149
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.


where do you read that cronie-noanacron equals to uninstall anacron?
Posted on: 2011/7/29 19:39
Create PDF from Post Print
Top
  •  gulikoza
      gulikoza
Re: Completely disable anacron but leave cron on.
#14
Regular Board Member
Joined: 2007/5/6
From
Posts: 87
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.
Posted on: 2011/7/29 19:25
Create PDF from Post Print
Top
  •  gerald_clark
      gerald_clark
Re: Completely disable anacron but leave cron on.
#13
Professional Board Member
Joined: 2005/8/5
From Northern Illinois, USA
Posts: 6261
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.
Posted on: 2011/7/29 18:07
Create PDF from Post Print
Top
  •  sblantipodi
      sblantipodi
Re: Completely disable anacron but leave cron on.
#12
Regular Board Member
Joined: 2009/7/10
From
Posts: 149
as someone saied anacron doesn't execute jobs in cron.hourly, so why my cron.hourly is executed two times every hour?
Posted on: 2011/7/29 17:36
Create PDF from Post Print
Top
  •  AlanBartlett
      AlanBartlett
Re: Completely disable anacron but leave cron on.
#11
Moderator
Joined: 2007/10/22
From ~/Earth/UK/England/Suffolk
Posts: 9188
So here's an experiment for you --

Add a line that reads "exclude = cronie-anacron" to your /etc/yum.conf file.
Remove the cronie-anacron package: rpm -e --nodeps cronie-anacron

Remember the golden rule -- if you break your system, you get to keep all the pieces!
_________________
Alan

100% Unix & Linux. Co-founder of the ELRepo Project.
Posted on: 2011/7/29 16:47
Create PDF from Post Print
Top
  •  sblantipodi
      sblantipodi
Re: Completely disable anacron but leave cron on.
#10
Regular Board Member
Joined: 2009/7/10
From
Posts: 149
Obviously I don't want to remove crond. :(
Posted on: 2011/7/29 6:27
Create PDF from Post Print
Top
  •  AlanBartlett
      AlanBartlett
Re: Completely disable anacron but leave cron on.
#9
Moderator
Joined: 2007/10/22
From ~/Earth/UK/England/Suffolk
Posts: 9188
How about --

sudo yum remove cronie-anacron

Of course, it may also want to remove cronie.
_________________
Alan

100% Unix & Linux. Co-founder of the ELRepo Project.
Posted on: 2011/7/28 22:05
Create PDF from Post Print
Top
  •  sblantipodi
      sblantipodi
Re: Completely disable anacron but leave cron on.
#8
Regular Board Member
Joined: 2009/7/10
From
Posts: 149
Just double checked, no duplicate entries in crontab.
Posted on: 2011/7/28 21:57
Create PDF from Post Print
Top
  •  sblantipodi
      sblantipodi
Re: Completely disable anacron but leave cron on.
#7
Regular Board Member
Joined: 2009/7/10
From
Posts: 149
service cronie-anacron status
cronie-anacron: unrecognized service
Posted on: 2011/7/28 21:54
Create PDF from Post Print
Top
  •  TrevorH
      TrevorH
Re: Completely disable anacron but leave cron on.
#6
Moderator
Joined: 2009/9/24
From Brighton, UK
Posts: 6560
But anacron doesn't do anything with /etc/cron.hourly. Are you sure you don't have duplicate lines in /etc/crontab that invoke runparts twice for /etc/cron.hourly?
_________________
Linux/VoIP Systems Administrator
Posted on: 2011/7/28 21:54
Create PDF from Post Print
Top
 Top   Previous Topic   Next Topic
12>

 


 You cannot start a new topic.
 You can view topic.
 You cannot reply to posts.
 You cannot edit your posts.
 You cannot delete your posts.
 You cannot add new polls.
 You cannot vote in polls.
 You cannot attach files to posts.
 You cannot post without approval.




"Linux" is a registered trademark of Linus Torvalds. | All other trademarks are property of their respective owners. | All other content is Copyright @ 2004-2009 by the CentOS Project or "each individual contributor (forums, comments, etc.) unless otherwise assigned".| Theme based on a theme by 7dana.com