Created
June 24, 2015 08:35
-
-
Save jobicoppola/f4c3d99972cb79f241df to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# Script to create a local CentOS mirror | |
# | |
rsync="/usr/bin/rsync -aqzH --delete --delete-after --delay-updates" | |
mirror=rsync://mirror.linux.duke.edu/centos | |
versionlist="5.11 6.6" | |
archlist="x86_64" | |
baselist_5="os updates extras centosplus contrib fasttrack addons" | |
baselist_6="os updates extras centosplus contrib fasttrack" | |
local=/home/osfilesweb/osfilesweb/htdocs/repos/centos | |
for version in $versionlist | |
do | |
majorversion=${version%.*} | |
for arch in $archlist | |
do | |
baselist="baselist_${majorversion}" | |
eval baselist=\$$baselist | |
for base in $baselist | |
do | |
subdir=$version/$base/$arch/ | |
if [ ! -d $local/$subdir ]; then | |
mkdir -p $local/$subdir | |
fi | |
remote=$mirror/$subdir | |
$rsync $remote $local/$subdir | |
done | |
done | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment