From 8d6b6af048d31cac1472692480b882ea8a655820 Mon Sep 17 00:00:00 2001 From: onefang Date: Wed, 3 Dec 2025 04:39:49 +0100 Subject: More docs. --- devuan_package_mirror_sync.sh | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'devuan_package_mirror_sync.sh') diff --git a/devuan_package_mirror_sync.sh b/devuan_package_mirror_sync.sh index 0f6ff3e..2e88782 100755 --- a/devuan_package_mirror_sync.sh +++ b/devuan_package_mirror_sync.sh @@ -1,5 +1,7 @@ #!/usr/bin/env bash +# This script syncs a Devuan Linux package mirror. + # I've not found a way to do this in one rsync call, so here's two. # # The first one adds any new actual package files, including source and such. @@ -7,7 +9,7 @@ # # The second one doesn't exclude anything, which will pick up the # metadata files excluded the first time, then delete anything that should -# be deleted. +# be deleted at the end. # # In this way the amount of time where your mirror isn't fully valid is minimised. @@ -15,7 +17,14 @@ # to your mirror, BEHAVE is limits on the rsync commands, OPTIONS # includes "--chown mirrors:www-data" change that to the user and group # you want your files to be. --exclude "/devuan-cd/" may need to be -# changed or removed if you run a file / ISO mirror. +# changed or removed if you run a file / ISO mirror or not. The numbers used for +# deciding to print stuff is just a rough guess to try to keep the emails down, +# adjust to suit. +# +# In general the last section could be tweaked or modified to suit the sorts of +# reports you need. For me reporting which Devuan packages got updated could be +# done simply, and I'm trying to keep this simple. Reporting which Debian packages +# changed is too complex, and I don't need it. # Stop on errors, and don't expand * set -ef @@ -81,6 +90,7 @@ OPTIONS="--delay-updates -rptSzhhv --no-motd --chown mirrors:www-data -M- mkdir -p ${MIRROR_PATH} + # The --exclude "/devuan-cd/" is so we don't wipe out the ISO mirror. start_time=$(date +%s%3N) rsltM=$( ${BEHAVE} rsync ${OPTIONS} vesta@pkgmaster.devuan.org:~/devuan/ ${MIRROR_PATH} --exclude "/devuan-cd/" \ @@ -91,6 +101,8 @@ start_time=$(date +%s%3N) rsltC=$( ${BEHAVE} rsync ${OPTIONS} -l --delete-delay vesta@pkgmaster.devuan.org:~/devuan/ ${MIRROR_PATH} --exclude "/devuan-cd/" ) end_time=$(date +%s%3N) ; durationC=$((end_time - start_time)) + +# Report the results. rsltM=$( echo "$rsltM" | grep -Ev '/$|\.svg|\.txt$|\.txt.old$|versionlog\.state|log/sources|aintainers$|/by-hash/|skipping non-regular file' | head -n -4 | tail -n +2 ) rsltC=$( echo "$rsltC" | grep -Ev '/$|\.svg|\.txt$|\.txt.old$|versionlog\.state|log/sources|aintainers$|/by-hash/' | head -n -3 | tail -n +2 ) if [ -n "$rsltM" ] ; then echo -e "$rsltM\n"; fi -- cgit v1.1