[Yum] Multiple machines & timeliness of updates.

Jim Perrin perrin at ohio.edu
Fri Dec 5 17:54:39 UTC 2003


I've got a decent script that I've been using for this. feel free to modify 
it to suit your needs.

I have this set to run as a crontab every day to keep up.


#!/bin/bash

### variables for the update script ###
dest="/var/www/html/pub/redhat/linux/updates/9/"
src="mirror.dulug.duke.edu::redhat-updates/9/"
lockfile="/var/tmp/mirror.lock"
rsync=`which rsync`
yumbuild=`which yum-arch`


### Do we have a way to get the files?
if [ ! -x $rsync ]; then
        echo "Unable to locate rsync. Make sure it is installed and in your 
path";
        exit 1;
fi
### Do we have a way to make the headers?
if [ ! -x $yumbuild ]; then
        echo "Unable to locate yum-arch. Make sure it's in your path";
        exit 1;
fi

## Look for a lockfile so we don't start running the update twice
if [ -f $lockfile ]; then
        echo "This update script is already  running or stalled."
        exit 0
else
        rm -rf $dest/headers
        touch $lockfile
        $rsync -azvH $src $dest
fi
### Build the RPM headers for yum
$yumbuild $dest

if [ $? -ne 0 ]; then
        rm -f $lockfile
        echo "Rebuilding of header files failed." > $HOME/yum.rebuild ;
        exit 1

else

        echo `/bin/date` > $dest/last-update.txt
        rm -f $lockfile
fi







--On Friday, December 05, 2003 11:42 AM -0500 "Hedemark, Magnus" 
<mhedemark at trueposition.com> wrote:

> Kerry Cox [mailto:kerry.cox at ksl.com] asks:
>
>> Setting up a yum repository or something similar is something I have
>> been meaning to do a long time. Are there any good texts out
>> there that
>> explain how?
>
> It's cake.
>
> 1) Identify a Linux box to act as your repository server.
> 2) Install ftp or http server software to grant clients access to your
> repository.
> 3) Install the yum suite on the server.
> 4) Mirror the RPM's that you want to host.  For example:
> 	rsync -aqH --delete mirror.physics.ncsu.edu::redhat/linux/9/en/os/
> /local/path/to/redhat/9/base/
> 5) "yum-arch /local/path/to/redhat/9/base/"
> 6) Share this path through ftp or http.  Set up your yum clients to point
> to this path.
> _______________________________________________
> Yum mailing list
> Yum at lists.dulug.duke.edu
> https://lists.dulug.duke.edu/mailman/listinfo/yum







More information about the Yum mailing list