[WBEL-users] local mirror without rsync using yum and lftp

King, John (Greg) (LMIT-HOU) Greg.King@lmit.com
Tue, 24 Aug 2004 09:24:47 -0500


I am in the process of setting up a local mirror but I will not be able to
use rsync to get the files due to the firewalls. I could change the
firewalls rules but this requires weeks of technical review meetings and
configuration control board meetings so instead I decided to use lftp's
mirror ability.

So far I have a simple script getting the updates (running now as i wrote it
this morning). My question is once I have these updates and check the gpg
signatures, is there anything more needed? Some of the docs list running
yum-arch but I am under the impression that this will not be needed since I
am mirroring the headers and the necessary update directories.

Heres my script so far, really basic. If I read the man pages correctly, it
should mirror the necessary directories, remove any local files that were
removed on the primary mirror and only download them if the files are newer
with the output going to the /tmp/$OUTFILE. Any suggestions to improve the
script would be nice.

Before running the script, do the following:

1. create the /var/www/wbel/{headers|i386|i686|noarch} directories
2. create a nonpriv user called <insert name here>
3. chown/chgrp the directories created in step 1 to the id created in step2
4. su to the id created in step 2
5. run the script
6. verify the rpm files (rpm --checksig *.rpm | grep 'NOT OK')

#!/bin/sh
#MIrrors the main repo

DATE=`/bin/date +%Y-%m-%d`
MIRROR=/var/www/wbel
OUTFILE=/tmp/mirror-output-$DATE.txt

cd /var/www/wbel/headers
lftp -e 'o
ftp://mirror.physics.ncsu.edu/pub/whitebox/3.0/en/updates/headers/ && mirror
--delete --only-newer --verbose && quit' >$
OUTFILE

cd /var/www/wbel/i386
lftp -e 'o ftp://mirror.physics.ncsu.edu/pub/whitebox/3.0/en/updates/i386/
&& mirror --delete --only-newer --verbose && quit' >>$OUT
FILE

cd /var/www/wbel/i686
lftp -e 'o ftp://mirror.physics.ncsu.edu/pub/whitebox/3.0/en/updates/i686/
&& mirror --delete --only-newer --verbose && quit' >>$OU
TFILE

cd /var/www/wbel/noarch
lftp -e 'o ftp://mirror.physics.ncsu.edu/pub/whitebox/3.0/en/updates/noarch/
&& mirror --delete --only-newer --verbose && quit' >>$
OUTFILE

Greg King