[WBEL-users] alternative mirrors for my purpose?

Kirby C. Bohling kbohling@birddog.com
Mon, 22 Nov 2004 17:31:14 -0600


On Mon, Nov 22, 2004 at 06:15:15PM -0500, Christian Reeves wrote:
>  
> > why not setup your own local repository that uses rsynch to 
> > keep itself updated with another mirror?
> 
> 
> After the reading over the past few days and considering I build servers
> frequently and maintain quite a few that's probably a great idea. Then, a
> mirror outage like we've seen recently would only hurt my ability to update
> and not slow my server build to a snail's pace. I'll look for info on how to
> make my own repository (I'm sure it's been covered in the list) IF you have
> any quick reference on how to get it going I would be much appreciative.


#!/bin/sh

# re-rsync'ing the entire os and iso dirs is probably overkill given
# that they never change.  However, it should be relatively light
# over rsync, and I want a script that always works from scratch.

RSYNC_BASE="rsync://mirror.physics.ncsu.edu/whitebox/"
versionList="3.0"

for ver in $versionList
do
        for subdir in os iso
        do
                for arch in i386
                do
                        echo "Fetching WhiteBox: /mirrors/whitebox/$ver/en/$subdir/"
                        mkdir -p /mirrors/whitebox/$ver/en/$subdir/$arch
                        rsync -avr -P $RSYNC_BASE/$ver/en/$subdir/$arch/.  /mirrors/whitebox/$ver/en/$subdir/$arch/.
                done
        done
        rsync -avr -P $RSYNC_BASE/$ver/en/updates/.  /mirrors/whitebox/$ver/en/updates/.
done

# God only knows what brain damage the mirrors have done to i386 and
# updates directory, I used to never do this, but after getting
# tired of waiting days for the mirrors and whiteboxlinux.org to
# re-sync, I do this myself if only so my repository will always
# have a consistant set of yum header files.

/usr/bin/yum-arch -s -v /mirrors/whitebox/3.0/en/os/i386
/usr/bin/yum-arch -s -v /mirrors/whitebox/3.0/en/updates
# End of shell script.

Run the above script, modifying the base path (I really should put
in MIRROR_PREFIX="/mirrors/whitebox", and use $MIRROR_PREFIX in the
script.


Then add this in the appropriate place to your httpd.conf:
(Personally, I place it in /etc/httpd/conf.d/kickstart.conf where I
put all the Apache directives to make my kickstart server go).

Alias /whitebox "/mirrors/whitebox"

<Directory "/mirrors/whitebox">
    Options Indexes FollowSymLinks
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>

Then do:

# service httpd restart

Use your favorite web browser to ensure that
http://hostname/whitebox does in fact work.

Now edit /etc/yum.conf to point to the correct relative path.

	Thanks,
		Kirby