[CentOS-mirror] Script to mirror i386

Grigorios G. Papazoglou

grp at med.uoc.gr
Thu Sep 21 16:38:57 UTC 2006

> *) Has anybody at hand a only-i386 rsync script to share with
> me?

this is the script I am using (I am not that familiar with shell 
scripting, so perhaps a fellow could suggest an easier way to do it). 
You can substitute '/data/mirrors' with the path you want the files to 
be stored at:



rsync -azvH --delete --delete-excluded --exclude "s390/" --exclude 
"x86_64/" --exclude "s390x/" --exclude "alpha/" --exclude "ia64/" 
eu-msync.centos.org::CentOS $MIRROR_PATH/centos

find $MIRROR_PATH/centos -type l | xargs file|grep broken|awk -F: 
'{print $1}' > $MIRROR_PATH/broken.txt
for i in `cat $MIRROR_PATH/broken.txt`; do rm $i; done
rm -f $MIRROR_PATH/broken.txt
chown -R root:nobody $MIRROR_PATH/centos
find $MIRROR_PATH/centos -type f -exec chmod 0644 {} \;
find $MIRROR_PATH/centos -type d -exec chmod 0755 {} \;

In the last few lines, I remove the broken links which are created 
because obviously we do not download nothing for other the platforms.

Hope this helps

More information about the CentOS-mirror mailing list