diff options
| author | onefang | 2025-11-27 04:21:24 +0100 |
|---|---|---|
| committer | onefang | 2025-11-27 04:21:24 +0100 |
| commit | fdc99319a41455203dc234607a692a870d869eb3 (patch) | |
| tree | c23361bab4b06a24a4195ac9b4e1c39b4e393f4c | |
| parent | Tidy things up, and only say the important things. (diff) | |
| download | devuan_package_mirror_sync-fdc99319a41455203dc234607a692a870d869eb3.zip devuan_package_mirror_sync-fdc99319a41455203dc234607a692a870d869eb3.tar.gz devuan_package_mirror_sync-fdc99319a41455203dc234607a692a870d869eb3.tar.bz2 devuan_package_mirror_sync-fdc99319a41455203dc234607a692a870d869eb3.tar.xz | |
More screwing with the output.
| -rwxr-xr-x | devuan_package_mirror_sync.sh | 38 |
1 files 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- | |||
| 71 | # --remote-option=OPT, -M send OPTION to the remote side only | 71 | # --remote-option=OPT, -M send OPTION to the remote side only |
| 72 | 72 | ||
| 73 | 73 | ||
| 74 | # These helped - | ||
| 75 | # https://git.devuan.org/devuan/amprolla3/src/branch/test/deployment/orchestrate.sh#L84 | ||
| 76 | # https://chrisgilmerproj.github.io/debian/mirror/rsync/2013/08/29/mirror-debian.html | ||
| 77 | # https://pkgmaster.devuan.org/devuan_mirror_walkthrough.txt | ||
| 78 | |||
| 79 | # Investigated rsync batch mode, seems crap for our use. | ||
| 80 | |||
| 74 | 81 | ||
| 75 | mkdir -p ${MIRROR_PATH} | 82 | mkdir -p ${MIRROR_PATH} |
| 83 | |||
| 76 | # The --exclude "/devuan-cd/" is so we don't wipe out the ISO mirror. | 84 | # The --exclude "/devuan-cd/" is so we don't wipe out the ISO mirror. |
| 77 | start_time=$(date +%s%3N) | 85 | start_time=$(date +%s%3N) |
| 78 | rslt=$( ${BEHAVE} rsync ${OPTIONS} vesta@pkgmaster.devuan.org:~/devuan/ ${MIRROR_PATH} --exclude "/devuan-cd/" \ | 86 | rsltM=$( ${BEHAVE} rsync ${OPTIONS} vesta@pkgmaster.devuan.org:~/devuan/ ${MIRROR_PATH} --exclude "/devuan-cd/" \ |
| 79 | --exclude "Packages*" --exclude "Sources*" --exclude "Release*" --exclude "InRelease" --exclude "Contents-*" --exclude "Translation-*" --exclude "ls-lR*" --exclude "current" --exclude ".~tmp~" \ | 87 | --exclude "Packages*" --exclude "Sources*" --exclude "Release*" --exclude "InRelease" --exclude "Contents-*" --exclude "Translation-*" --exclude "ls-lR*" --exclude "current" --exclude ".~tmp~" ) |
| 80 | | grep -Ev '/$|\.svg|\.txt$|\.txt.old$|versionlog\.state|log/sources|aintainers$|/by-hash/|skipping non-regular file' | head -n -4 | tail -n +2 ) | 88 | end_time=$(date +%s%3N) ; durationM=$((end_time - start_time)) |
| 81 | end_time=$(date +%s%3N) ; duration_ms=$((end_time - start_time)) | ||
| 82 | echo -n "$rslt"; if [ -n "$rslt" ] ; then echo ""; fi | ||
| 83 | if [ $duration_ms -gt 2000 ] ; then echo -e "Main rsync time in ms: $duration_ms\n"; fi | ||
| 84 | 89 | ||
| 85 | start_time=$(date +%s%3N) | 90 | start_time=$(date +%s%3N) |
| 86 | rslt=$( ${BEHAVE} rsync ${OPTIONS} -l --delete-delay vesta@pkgmaster.devuan.org:~/devuan/ ${MIRROR_PATH} --exclude "/devuan-cd/" \ | 91 | rsltC=$( ${BEHAVE} rsync ${OPTIONS} -l --delete-delay vesta@pkgmaster.devuan.org:~/devuan/ ${MIRROR_PATH} --exclude "/devuan-cd/" ) |
| 87 | | grep -Ev '/$|\.svg|\.txt$|\.txt.old$|versionlog\.state|log/sources|aintainers$|/by-hash/' | head -n -3 | tail -n +2 ) | 92 | end_time=$(date +%s%3N) ; durationC=$((end_time - start_time)) |
| 88 | end_time=$(date +%s%3N) ; duration_ms=$((end_time - start_time)) | ||
| 89 | echo -n "$rslt"; if [ -n "$rslt" ] ; then echo ""; fi | ||
| 90 | if [ $duration_ms -gt 1000 ] ; then echo "Clean up rsync time in ms: $duration_ms"; fi | ||
| 91 | 93 | ||
| 92 | 94 | 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 ) | |
| 93 | 95 | rsltC=$( echo "$rsltC" | grep -Ev '/$|\.svg|\.txt$|\.txt.old$|versionlog\.state|log/sources|aintainers$|/by-hash/' | head -n -3 | tail -n +2 ) | |
| 94 | # These helped - | 96 | if [ -n "$rsltM" ] ; then echo -e "$rsltM\n"; fi |
| 95 | # https://git.devuan.org/devuan/amprolla3/src/branch/test/deployment/orchestrate.sh#L84 | 97 | if [ $durationM -gt 3000 ] || [ -n "$rsltM" ] ; then echo -e "Main rsync time: $durationM ms.\n"; fi |
| 96 | # https://chrisgilmerproj.github.io/debian/mirror/rsync/2013/08/29/mirror-debian.html | 98 | if [ -n "$rsltC" ] ; then echo -e "$rsltC\n"; fi |
| 97 | # https://pkgmaster.devuan.org/devuan_mirror_walkthrough.txt | 99 | if [ $durationC -gt 2000 ] || [ -n "$rsltC" ] ; then echo -e "Clean up rsync time: $durationC ms.\n"; fi |
| 98 | |||
| 99 | # Investigated rsync batch mode, seems crap for our use. | ||
