Completely disable anacron but leave cron on.
- 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.
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! ;-)
[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! ;-)
-
- Posts: 252
- Joined: 2009/07/10 09:43:13
- Contact:
Re: Completely disable anacron but leave cron on.
as someone saied anacron doesn't execute jobs in cron.hourly, so why my cron.hourly is executed two times every hour?
-
- Posts: 10642
- Joined: 2005/08/05 15:19:54
- Location: Northern Illinois, USA
Completely disable anacron but leave cron on.
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.
cronie
cronie-anacron
cronie-noanacron
cronie-anacron does include /etc/cron.hourly/0anacron
Perhaps you want to install cronie-noanacron instead of cronie-anacron.
Re: Completely disable anacron but leave cron on.
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.
Installing cronie-noanacron will enable uninstalling cronie-anacron without breaking dependencies.
-
- Posts: 252
- Joined: 2009/07/10 09:43:13
- Contact:
Re: Completely disable anacron but leave cron on.
[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 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?
Re: Completely disable anacron but leave cron on.
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.
- 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.
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]
[code]
[b]sudo yum install cronie-noanacron
sudo yum remove cronie-anacron[/b]
[/code]
-
- Posts: 252
- Joined: 2009/07/10 09:43:13
- Contact:
Re: Completely disable anacron but leave cron on.
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?
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?
-
- Posts: 252
- Joined: 2009/07/10 09:43:13
- Contact:
Re: Completely disable anacron but leave cron on.
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
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
Re: Completely disable anacron but leave cron on.
/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).
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).