This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
centos_local_repo_rsync [2011/07/11 17:56] jt created |
— (current) | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | |||
- | |||
- | <code bash> | ||
- | #!/bin/bash | ||
- | |||
- | # name: centos-rsync | ||
- | # date: 20110711 | ||
- | # author: jason thomas <jthomas@blip.tv> | ||
- | # purpose: update local centos mirror with remote centos mirror | ||
- | |||
- | LOCK="/var/lock/subsys/centos-rsync" | ||
- | REPO="/var/www/kitchen/htdocs/repos/centos" | ||
- | MIRROR="mirror.cogentco.com" | ||
- | |||
- | CURRENT5="5.6" | ||
- | CURRENT6="6.0" | ||
- | |||
- | if [ -f $LOCK ]; then | ||
- | exit 0 | ||
- | fi | ||
- | |||
- | control_sigint(){ | ||
- | unlink $LOCK | ||
- | exit $? | ||
- | } | ||
- | |||
- | trap control_sigint SIGINT | ||
- | |||
- | if [ -d $REPO/$CURRENT5 ] ; then | ||
- | touch $LOCK | ||
- | rsync -avSHP --delete --exclude "local*" --exclude "isos" --exclude "i386" $MIRROR::CentOS/$CURRENT5/ $REPO/$CURRENT5/ | ||
- | unlink $LOCK | ||
- | fi | ||
- | |||
- | if [ -d $REPO/$CURRENT6 ] ; then | ||
- | touch $LOCK | ||
- | rsync -avSHP --delete --exclude "local*" --exclude "isos" --exclude "i386" $MIRROR::CentOS/$CURRENT6/ $REPO/$CURRENT6/ | ||
- | unlink $LOCK | ||
- | fi | ||
- | </code> |