Enable Yum As A Nightly Service

simon andrews (BI) simon.andrews at bbsrc.ac.uk
Wed Mar 3 14:40:44 UTC 2004


Clint Harshaw wrote:
> 
> I'm not using the patch (I simply wanted to show that I had done my 
> homework prior to posting) because I haven't seen anyone else's yum.conf 
> that uses it. And I am using mirrors -- my yum.conf is basically the 
> same one found at the artoo site.
> 
> The same symptoms are going on at my work machine as well (which I am at 
> right now). I have yum checked in services, I'm using mirrors, but it's 
> not doing the updates.

By any chance do you access the internet via a proxy server?  If so then 
yum will pick up the proxy address from the HTTP_PROXY environment 
variable when you run it interactively (you didn't say, but I'm assuming 
that if you run "yum update" manually then everything's OK?), but will 
fail from the overnight cron job.

The trouble is that the cron environment doesn't have the proxy 
information in it so you need to hack the yum cron script to do this for 
you.

Below is my yum.cron script.  Just adjust the proxy values to match your 
site details and it should work OK.

$ more /etc/cron.daily/yum.cron
#!/bin/sh

export http_proxy=http://wwwcache.example.com:8080

if [ -f /var/lock/subsys/yum ]; then
         /usr/bin/yum -R 10 -e 0 -d 0 -y update yum
         /usr/bin/yum -R 120 -e 0 -d 0 -y update
fi





More information about the fedora-list mailing list