#!/bin/sh # rsync (mirror) the latest updates locally. # Rich West # # Need to perform some checksum matching. Rsync seems to be corrupting # some of the RPMS. #xsltproc repomdtoshasum.xslt repodata/repomd.xml | sha1sum -c #gunzip -c repodata/primary.xml.gz | xsltproc primarytoshasum.xslt - | sha1sum -c CREATEREPO=0 RSYNC_OPTIONS=" \ --verbose --progress --stats \ --delete \ --archive \ --exclude debug \ --exclude repodata" if [ "$1" != "-d" ] || [ "X$2" = "X" ]; then echo "Usage: $0 -d <32bit | 64bit | all> [-r]" echo exit; fi if [ "$3" = "-r" ]; then CREATEREPO=1 fi MIRROR1=/export/store/repos/6/i386/updates MIRROR2=/export/store/repos/6/x86_64/updates RSYNC_HOST=distro.ibiblio.org::distros/fedora/linux/core/updates/6 rm -rf $MIRROR1/.olddata $MIRROR2/.olddata OUTFILE=/tmp/rsync.output if [ "$2" = "32bit" ] || [ "$2" = "all" ]; then ## # Sync up the 'updates' tree for the 32bit distribution. ## /bin/nice /usr/bin/rsync $RSYNC_OPTIONS \ $RSYNC_HOST/i386/ $MIRROR1 \ >> $OUTFILE ## # Build the repo data ## if [ "$CREATEREPO" = "1" ]; then /usr/bin/createrepo -q $MIRROR1 cd $MIRROR1 /usr/bin/repoview -q . cd / fi fi if [ "$2" = "64bit" ] || [ "$2" = "all" ]; then ## # Sync up the 'updates' tree for the 64 bit distribution ## /bin/nice /usr/bin/rsync $RSYNC_OPTIONS \ $RSYNC_HOST/x86_64/ $MIRROR2 \ >> $OUTFILE ## # Build the repo data ## if [ "$CREATEREPO" = "1" ]; then /usr/bin/createrepo -q $MIRROR2 cd $MIRROR2 /usr/bin/repoview -q . cd / fi fi