]> asedeno.scripts.mit.edu Git - sipb-mirrors.git/commitdiff
Enable mirroring for backports.
authorLuke W. Faraone <lfaraone@mit.edu>
Sun, 7 Apr 2013 22:24:26 +0000 (18:24 -0400)
committerAlexander Chernyakhovsky <achernya@mit.edu>
Sun, 7 Apr 2013 22:47:34 +0000 (18:47 -0400)
fetch-scripts/debian-backports [new file with mode: 0644]

diff --git a/fetch-scripts/debian-backports b/fetch-scripts/debian-backports
new file mode 100644 (file)
index 0000000..bad2a98
--- /dev/null
@@ -0,0 +1,29 @@
+#! /bin/bash
+
+set -x
+set -v
+set -e
+set -u
+
+#MIRRORDIR=/ifs/mirror
+BASEDIR=${MIRRORDIR}/debian-backports
+RSYNCSOURCE=rsync://debian.gtisc.gatech.edu/debian-backports/
+
+RSYNC_OPTS="--recursive --links --hard-links --times --sparse --hard-links --block-size=8192 --timeout 3600 --perms"
+#OTHER_OPTS="--verbose --stats --dry-run"
+OTHER_OPTS="--verbose --stats"
+
+# Options we only use in the first pass, where we do not want packages/sources to fly in yet and dont want to delete files
+PASS1="--exclude Packages\* --exclude Sources\* --exclude Release\* --exclude ls-lR\*"
+# Options for the second pass, where we do want everything, including deletion of old and now unused files
+PASS2="--max-delete=40000 --delay-updates --delete --delete-after --delete-excluded --exclude \"project/trace/${HOSTNAME}\""
+
+# The temp directory used by rsync --delay-updates is not
+# world-readable remotely. Always exclude it to avoid errors. 
+EXCLUDE="--exclude .~tmp~/"
+
+rsync ${RSYNC_OPTS} ${OTHER_OPTS} ${PASS1} ${EXCLUDE} ${RSYNCSOURCE} ${BASEDIR}
+rsync ${RSYNC_OPTS} ${OTHER_OPTS} ${PASS2} ${EXCLUDE} ${RSYNCSOURCE} ${BASEDIR}
+
+mkdir -p ${BASEDIR}/project/trace
+date -u > ${BASEDIR}/project/trace/mirrors.mit.edu