[Solved]yum, crontab and logwatch

Sharon Kimble sharonm63 at tiscali.co.uk
Sun Nov 21 11:35:51 UTC 2004


Ed Wilts, RHCE wrote:

> On 11/20/2004 07:59 AM, Sharon Kimble wrote:
>> I'm trying to write a crontab entry to run yum update at 0100 and this is
>> as far as I've got '0 1 * * * /usr/bin/yum update' but I'm unsure if this
>> will work. Can anyone reassure me please, or if not, what is the correct
>> syntax?
>> 
>> I know that I can run it as a 'service' but that means that it runs at
>> the same time as logwatch and it then doesn't get recorded in logwatch,
>> so I'm hoping that if I run it in advance of logwatch, then logwatch will
>> record it.
> 
> Simply take /etc/cron.daily/yum.cron and move it to /usr/local/bin. Edit
> it to remove the if/fi block.  Then your crontab entry would be:
> 
> 0 1 * * * /usr/local/bin/yum.cron
> 
> This is all that would be left of yum.cron:
> 
> #!/bin/sh
> /usr/bin/yum -R 10 -e 0 -d 0 -y update yum
> /usr/bin/yum -R 120 -e 0 -d 0 -y update
> 
> .../Ed
> 
Thanks Ed, this worked pefectly :)

Sharon.
-- 
 11:35:06 up 3 days, 21:13,  1 user,  load average: 1.24, 1.25, 1.26

Linux is like a wigwam, no windows, no gates, apache inside.
Fedora Core 3, KDE 3.3.1-2.2, OpenOffice 1.1.3
Registered Linux user 334501





More information about the users mailing list