From fdc99319a41455203dc234607a692a870d869eb3 Mon Sep 17 00:00:00 2001 From: onefang Date: Thu, 27 Nov 2025 04:21:24 +0100 Subject: More screwing with the output. --- devuan_package_mirror_sync.sh | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/devuan_package_mirror_sync.sh b/devuan_package_mirror_sync.sh index 75e23a2..bb8fa66 100755 --- a/devuan_package_mirror_sync.sh +++ b/devuan_package_mirror_sync.sh @@ -71,29 +71,29 @@ OPTIONS="--delay-updates -rptSzhhv --no-motd --chown mirrors:www-data -M- # --remote-option=OPT, -M send OPTION to the remote side only +# These helped - +# https://git.devuan.org/devuan/amprolla3/src/branch/test/deployment/orchestrate.sh#L84 +# https://chrisgilmerproj.github.io/debian/mirror/rsync/2013/08/29/mirror-debian.html +# https://pkgmaster.devuan.org/devuan_mirror_walkthrough.txt + +# Investigated rsync batch mode, seems crap for our use. + mkdir -p ${MIRROR_PATH} + # The --exclude "/devuan-cd/" is so we don't wipe out the ISO mirror. start_time=$(date +%s%3N) -rslt=$( ${BEHAVE} rsync ${OPTIONS} vesta@pkgmaster.devuan.org:~/devuan/ ${MIRROR_PATH} --exclude "/devuan-cd/" \ - --exclude "Packages*" --exclude "Sources*" --exclude "Release*" --exclude "InRelease" --exclude "Contents-*" --exclude "Translation-*" --exclude "ls-lR*" --exclude "current" --exclude ".~tmp~" \ - | grep -Ev '/$|\.svg|\.txt$|\.txt.old$|versionlog\.state|log/sources|aintainers$|/by-hash/|skipping non-regular file' | head -n -4 | tail -n +2 ) -end_time=$(date +%s%3N) ; duration_ms=$((end_time - start_time)) -echo -n "$rslt"; if [ -n "$rslt" ] ; then echo ""; fi -if [ $duration_ms -gt 2000 ] ; then echo -e "Main rsync time in ms: $duration_ms\n"; fi +rsltM=$( ${BEHAVE} rsync ${OPTIONS} vesta@pkgmaster.devuan.org:~/devuan/ ${MIRROR_PATH} --exclude "/devuan-cd/" \ + --exclude "Packages*" --exclude "Sources*" --exclude "Release*" --exclude "InRelease" --exclude "Contents-*" --exclude "Translation-*" --exclude "ls-lR*" --exclude "current" --exclude ".~tmp~" ) +end_time=$(date +%s%3N) ; durationM=$((end_time - start_time)) start_time=$(date +%s%3N) -rslt=$( ${BEHAVE} rsync ${OPTIONS} -l --delete-delay vesta@pkgmaster.devuan.org:~/devuan/ ${MIRROR_PATH} --exclude "/devuan-cd/" \ - | grep -Ev '/$|\.svg|\.txt$|\.txt.old$|versionlog\.state|log/sources|aintainers$|/by-hash/' | head -n -3 | tail -n +2 ) -end_time=$(date +%s%3N) ; duration_ms=$((end_time - start_time)) -echo -n "$rslt"; if [ -n "$rslt" ] ; then echo ""; fi -if [ $duration_ms -gt 1000 ] ; then echo "Clean up rsync time in ms: $duration_ms"; fi +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)) - - -# These helped - -# https://git.devuan.org/devuan/amprolla3/src/branch/test/deployment/orchestrate.sh#L84 -# https://chrisgilmerproj.github.io/debian/mirror/rsync/2013/08/29/mirror-debian.html -# https://pkgmaster.devuan.org/devuan_mirror_walkthrough.txt - -# Investigated rsync batch mode, seems crap for our use. +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 +if [ $durationM -gt 3000 ] || [ -n "$rsltM" ] ; then echo -e "Main rsync time: $durationM ms.\n"; fi +if [ -n "$rsltC" ] ; then echo -e "$rsltC\n"; fi +if [ $durationC -gt 2000 ] || [ -n "$rsltC" ] ; then echo -e "Clean up rsync time: $durationC ms.\n"; fi -- cgit v1.1