yum, crontab and logwatch

Ed Wilts, RHCE ewilts at ewilts.org
Sat Nov 20 14:56:19 UTC 2004


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

-- 
Ed Wilts, RHCE
Mounds View, MN, USA
mailto:ewilts at ewilts.org
Member #1, Red Hat Community Ambassador Program




More information about the users mailing list