summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xsyncrepo.sh11
1 files changed, 10 insertions, 1 deletions
diff --git a/syncrepo.sh b/syncrepo.sh
index 73436b5..23cc26e 100755
--- a/syncrepo.sh
+++ b/syncrepo.sh
@@ -1,11 +1,20 @@
#!/bin/bash
+# This is a simple mirroring script. To save bandwidth it first checks a
+# timestamp via HTTP and only runs rsync when the timestamp differs from the
+# local copy. As of 2016, a single rsync run without changes transfers roughly
+# 6MiB of data which adds up to roughly 250GiB of traffic per month. Performing
+# a simple check via HTTP first can thus save a lot of traffic.
+
home="/srv"
target="${home}/repo"
tmp="${home}/tmp"
lock='/tmp/mirrorsync.lck'
+# NOTE: You'll probably want to change this or remove the --bwlimit setting in
+# the rsync call below
bwlimit=4096
-# NOTE: you very likely need to change this since rsync.archlinux.org requires you to be a tier 1 mirror
+# NOTE: most people reading this very likely need to change this since
+# rsync.archlinux.org requires you to be a tier 1 mirror
source='rsync://rsync.archlinux.org/ftp_tier1'
lastupdate_url="http://rsync.archlinux.org/lastupdate"