]> asedeno.scripts.mit.edu Git - sipb-mirrors.git/commitdiff
Added mirroring script for torproject.org
authorLizhou Sha <slz@mit.edu>
Fri, 14 Aug 2015 04:52:11 +0000 (00:52 -0400)
committerLizhou Sha <slz@mit.edu>
Fri, 14 Aug 2015 04:52:11 +0000 (00:52 -0400)
Signed-off-by: Lizhou Sha <slz@mit.edu>
fetch-scripts/torproject [new file with mode: 0644]

diff --git a/fetch-scripts/torproject b/fetch-scripts/torproject
new file mode 100644 (file)
index 0000000..e3f4429
--- /dev/null
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+# Consult the official Tor Project mirroring manual at
+# https://www.torproject.org/docs/running-a-mirror.html.en
+
+set -x
+set -v
+set -e
+set -u
+
+RSYNCSOURCE=rsync://rsync.torproject.org
+RSYNCWEBSOURCE=${RSYNCSOURCE}/website-mirror/
+RSYNCDISTSOURCE=${RSYNCSOURCE}/dist-mirror/
+BASEWEBDIR=${MIRRORDIR}/torproject
+BASEDISTDIR=${BASEWEBDIR}/dist
+
+RSYNC_OPTS="--archive --delete"
+OTHER_OPTS="--stats --verbose"
+
+rsync ${RSYNC_OPTS} ${OTHER_OPTS} \
+      --exclude dist \
+      ${RSYNCWEBSOURCE} ${BASEWEBDIR}
+
+rsync ${RSYNC_OPTS} ${OTHER_OPTS} \
+      ${RSYNCDISTSOURCE} ${BASEDISTDIR}