[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: cron.daily logrotate beating up my server



On Mi, 26 feb 14, 06:41:22, Tony Baldwin wrote:
> On Wed, Feb 26, 2014 at 12:09:05PM +0200, Andrei POPESCU wrote:
> > On Ma, 25 feb 14, 13:53:39, Tazman Deville wrote:
> > > 
> > > I DO have anacron installed.
> > 
> > Well, purge (not remove) it then, or adjust /etc/anacrontab as needed ;)
> 
> Thanks, Andrei,
> But could you explain why I want to purge anacron, please?

You are not the OP, so I have no idea why *you* would want/need to purge 
anacron :p but I'll explain anyway (using my /etc/crontab as example):

# m h dom mon dow user	command
17 *	* * *	root    cd / && run-parts --report /etc/cron.hourly
25 6	* * *	root	test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )
47 6	* * 7	root	test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly )
52 6	1 * *	root	test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly )
#
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

The 'test ... ||' part makes sure that if you have the /usr/sbin/anacron 
binary on your system the other part will *not* be executed at all. If 
you do however need anacron, but want to adjust the time where the 
equivalent task is run you will have to adjust /etc/anacrontab instead 
as I've written above (because anacron will be running it). In my case 
it's:

# These replace cron's entries
1	5	cron.daily	run-parts --report /etc/cron.daily
7	10	cron.weekly	run-parts --report /etc/cron.weekly
@monthly	15	cron.monthly	run-parts --report /etc/cron.monthly

According to anacrontab(5) the first number represents a period (in 
days) and the second a delay (in minutes). At first sight there doesn't 
appear to be an easy way to control the exact time where a job is run, 
so I'd say it's easier to just remove anacron and work only with cron ;)

Kind regards,
Andrei
-- 
http://wiki.debian.org/FAQsFromDebianUser
Offtopic discussions among Debian users and developers:
http://lists.alioth.debian.org/mailman/listinfo/d-community-offtopic
http://nuvreauspam.ro/gpg-transition.txt

Attachment: signature.asc
Description: Digital signature


Reply to: