diff options
author | doc <doc@filenotfound.org> | 2025-09-14 22:13:41 +0000 |
---|---|---|
committer | doc <doc@filenotfound.org> | 2025-09-14 22:13:41 +0000 |
commit | 13eb2d51c7284472efabc278bf9b7ec0b8575e47 (patch) | |
tree | 9f0ea15fdc908a2afe4d315beb112fe9545db02e /archmirror-repos.sh |
Diffstat (limited to 'archmirror-repos.sh')
-rwxr-xr-x | archmirror-repos.sh | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/archmirror-repos.sh b/archmirror-repos.sh new file mode 100755 index 0000000..f15504a --- /dev/null +++ b/archmirror-repos.sh @@ -0,0 +1,24 @@ +#!/usr/bin/env bash +# /usr/local/sbin/archmirror-repos.sh +set -euo pipefail +UPSTREAM="rsync://mirror.csclub.uwaterloo.ca/archlinux/" +STAGE="/brimstone3/mirror-stage/arch-repos" +LIVE="/brimstone1/mirror/archlinux" +LOG="/var/log/mirrors/arch-repos.log" + +mkdir -p "$STAGE" "$LIVE" + +rsync -rtlH --safe-links --delete-delay --delay-updates \ + --exclude iso/ --exclude other/ \ + "$UPSTREAM" "$STAGE" | tee -a "$LOG" + +rsync -rtlH --safe-links --delete-delay --delay-updates \ + --exclude iso/ --exclude other/ \ + "$UPSTREAM" "$STAGE" | tee -a "$LOG" + +curl -fsS https://geo.mirror.pkgbuild.com/lastsync > "$LIVE/lastsync" \ + || date -u +%s > "$LIVE/lastsync" + +ln -sfn "$STAGE" "$LIVE" +date -u +%s > "$LIVE/lastsync" + |