#!/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"