[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.


### variables for the update script ###
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 
        exit 1;
### 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;

## 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
        rm -rf $dest/headers
        touch $lockfile
        $rsync -azvH $src $dest
### 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


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

--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