This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | |||
centos_local_repo_rsync [2011/07/15 20:39] jt |
— (current) | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | <code bash> | ||
- | #!/bin/bash | ||
- | # name: centos-rsync | ||
- | # date: 20110711 | ||
- | # author: jason thomas <jason@lithiumfox.com> | ||
- | # 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" | ||
- | |||
- | |||
- | sync_repo(){ | ||
- | ( flock 200 | ||
- | if [ -d $REPO/$@ ] ; then | ||
- | rsync -avSHP --delete --exclude "local*" --exclude "isos" --exclude "i386" $MIRROR::CentOS/$@/ $REPO/$@/ | ||
- | fi | ||
- | ) 200>$LOCK$@ | ||
- | } | ||
- | |||
- | sync_repo $CURRENT5 & | ||
- | sync_repo $CURRENT6 & | ||
- | </code> |