[CentOS] Script to sync with repo

Wed Jul 20 19:56:29 UTC 2011
Paul Heinlein <heinlein at madboa.com>

On Wed, 20 Jul 2011, Jerry Geis wrote:

> under 5.6 I have a script that runs every night to rsync the repodata
> for local installations.
> I added the 6.0 to do the same.
>
> Something seems wrong now for 6.0. I do the same thing and I get errors
> from my local repo at install time.
> Seems like the cyrus-sasl package is never happy and aborts the
> installation.
>
> Is something wrong with the script below? It seems like it successfully
> copies the files.
> I ran it manually and did not see any errors.
>
> Any thoughts?
>
> Thanks,
>
> Jerry
>
> # The kickstart files point to the "repo"
> #
> # This file will creat the directories and copy the files
> #
> for VERSION in "5.6" "6.0"
> do
>        mkdir -p /var/www/html/centos/$VERSION/updates/x86_64/RPMS
>        mkdir -p /var/www/html/centos/$VERSION/updates/x86_64/repodata
>
>        rsync -av
> rsync://mirrors.kernel.org/mirrors/centos/$VERSION/updates/x86_64/RPMS/*
> /var/www/html/centos/$VERSION/updates/x86_64/RPMS
>        rsync -av
> rsync://mirrors.kernel.org/mirrors/centos/$VERSION/updates/x86_64/repodata/*
> /var/www/html/centos/$VERSION/updates/x86_64/repodata
> done

Here's my script. Obviously, it picks up the os/ tree as well as the 
updates/ tree. So far, no problems with 5.x or 6.x:

#!/bin/sh
for VERS in "5.6" "6.0"; do
   SRC="ftp.osuosl.org::centos/${VERS}/"
   DEST="/srv/mirrors/centos/${VERS}/"
   echo "-----------------------------------------------------------"
   echo "Sync-ing CentOS $VERS with $SRC"
   echo
   /usr/bin/rsync -avSH \
     --exclude "isos" --exclude "centosplus" --exclude "extras" \
     $SRC $DEST
   echo "-----------------------------------------------------------"
done

-- 
Paul Heinlein <> heinlein at madboa.com <> http://www.madboa.com/