diff options
author | Robin H. Johnson <robbat2@gentoo.org> | 2021-11-12 09:59:08 -0800 |
---|---|---|
committer | Robin H. Johnson <robbat2@gentoo.org> | 2021-11-12 10:00:31 -0800 |
commit | 8623ef538cf32aaf4d46982c5e22569ae72ed8b0 (patch) | |
tree | 7c88adf671cf114a72608f5e18e06fc2a1df70ca /scripts | |
parent | Actually remove dead txt files (diff) | |
download | releng-8623ef538cf32aaf4d46982c5e22569ae72ed8b0.tar.gz releng-8623ef538cf32aaf4d46982c5e22569ae72ed8b0.tar.bz2 releng-8623ef538cf32aaf4d46982c5e22569ae72ed8b0.zip |
scripts/copy_buildsync: dead detection works too well, send to files instead
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/copy_buildsync.sh | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/scripts/copy_buildsync.sh b/scripts/copy_buildsync.sh index f7f9a3df..0308da39 100755 --- a/scripts/copy_buildsync.sh +++ b/scripts/copy_buildsync.sh @@ -6,6 +6,8 @@ INCOMING_BASE="/release/weekly/builds" OUTGOING_BASE="/release/distfiles/weekly" # Scratch space used when moving files from incoming to outgoing. TMPDIR_BASE="/release/distfiles/tmp/buildsync/partial" +# Keep some records +LOGDIR_BASE="/release/distfiles/tmp/buildsync/logs" ARCHES=( alpha @@ -64,7 +66,7 @@ EOF # Copy artifacts for an arch to the outgoing directory. copy_arch_to_outgoing() { - local ARCH=$1 indir=$2 outdir=$3 tmpdir=$4 + local ARCH=$1 indir=$2 outdir=$3 tmpdir=$4 logdir=$5 local i t rc timestamps if [[ ! -d ${indir} ]]; then @@ -91,6 +93,7 @@ copy_arch_to_outgoing() { "${RSYNC_OPTS[@]}" \ --temp-dir="${tmpdir}" \ --partial-dir="${tmpdir}" \ + --log-file="${logdir}/rsync.log" \ --filter '- **/.*' \ --filter "S *${i}*" \ --filter 'S **/' \ @@ -126,11 +129,12 @@ process_arch() { indir="${INCOMING_BASE}/${ARCH}" outdir="${OUTGOING_BASE}/${ARCH}" tmpdir="${TMPDIR_BASE}/${ARCH}" + logdir="${LOGDIR_BASE}/${ARCH}" - mkdir -p "${tmpdir}" 2>/dev/null + mkdir -p "${tmpdir}" "${logdir}" 2>/dev/null # Sync incoming->outgoing first. - copy_arch_to_outgoing "${ARCH}" "${indir}" "${outdir}" "${tmpdir}" + copy_arch_to_outgoing "${ARCH}" "${indir}" "${outdir}" "${tmpdir}" "${logdir}" # ================================================================ # Build data for revealing latest: @@ -216,10 +220,7 @@ process_arch() { # Find the dead links for cleanup _dead="${tmpdir}"/dead-link find -L $(pwd) -type l >"${_dead}" - if test -s "${_dead}"; then - echo "copy_buildsync: dead links to verify:" 1>&2 - cat "${_dead}" 1>&2 - fi + mv -f "${_dead}" "${logdir}/dead-links.txt" # Find the dead latest txt files _dead="${tmpdir}"/dead-latest @@ -235,6 +236,7 @@ process_arch() { | fgrep -l -f - $f \ | xargs -n1 --no-run-if-empty readlink -f done >"${_dead}" + if test -s "${_dead}"; then echo "copy_buildsync: removing dead latest*txt files:" 1>&2 foreach txtfil in $(cat "${_dead}") ; do @@ -242,11 +244,14 @@ process_arch() { done fi + mv -f "${_dead}" "${logdir}/dead-latest-txt.txt" + # Cleanup tmpdir $DEBUGP rm $VERBOSEP -rf "${tmpdir}" else echo "There was some failure for $ARCH during the weekly sync. Not doing cleanup for fear of dataloss." 1>&2 + echo "See logs in $logdir" 1>&2 fi } |