summaryrefslogtreecommitdiffstats
path: root/syncrepo
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2010-04-10 02:33:02 +0200
committerPierre Schmitz <pierre@archlinux.de>2010-04-10 02:33:02 +0200
commitce1d818e401e640dea188926ab66b7113d0c067f (patch)
tree7a3795071fb62ca62700a11a845cebe06f16214a /syncrepo
downloadrepo-tools-ce1d818e401e640dea188926ab66b7113d0c067f.tar.gz
repo-tools-ce1d818e401e640dea188926ab66b7113d0c067f.tar.xz
initial commit
Diffstat (limited to 'syncrepo')
-rwxr-xr-xsyncrepo29
1 files changed, 29 insertions, 0 deletions
diff --git a/syncrepo b/syncrepo
new file mode 100755
index 0000000..1803b8c
--- /dev/null
+++ b/syncrepo
@@ -0,0 +1,29 @@
+#!/bin/bash
+
+home="$(dirname "${0}")"
+target="${home}/repo"
+lock='/tmp/mirrorsync.lck'
+source='-e ssh gerolde.archlinux.org:/srv/ftp'
+repos='core,extra,testing,community,community-testing'
+
+[ ! -d "${target}" ] && exit 1
+[ -f "${lock}" ] && exit 1
+touch "${lock}"
+
+rsync -rptlv --safe-links --delete --progress -h \
+ --include='*/' \
+ --include='*.db.tar.gz' \
+ --exclude='*' \
+ ${source}/{${repos}} \
+ "${target}"
+
+rsync -rptlv --safe-links --delete --progress -h \
+ --exclude='*.db.tar.gz*' \
+ --exclude='*.abs.tar.gz*' \
+ --exclude='*.files.tar.gz*' \
+ --exclude='*.links.tar.gz*' \
+ --exclude='lastsync' \
+ ${source}/{${repos}} \
+ "${target}"
+
+rm -f "${lock}"