From 5f71e25343e0f73b04c308d906e264680826f582 Mon Sep 17 00:00:00 2001 From: Fred Hamster Date: Sat, 14 Dec 2024 18:19:29 -0500 Subject: [PATCH] better logging on errors --- scripts/customize/fred/scripts/jobby/archie_grabber.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/customize/fred/scripts/jobby/archie_grabber.sh b/scripts/customize/fred/scripts/jobby/archie_grabber.sh index 9995a287..85b3348f 100644 --- a/scripts/customize/fred/scripts/jobby/archie_grabber.sh +++ b/scripts/customize/fred/scripts/jobby/archie_grabber.sh @@ -26,13 +26,14 @@ function grab_archies() local cp_outfile="$(mktemp /tmp/archie_grabber.XXXXXX)" netcp ${host}.${domain_piece}:${ARCHIVE_DIR_PREFIX}* . &> "$cp_outfile" retval=$? -#hmmm: could display the output on error. and we have a function for that... - rm "$cp_outfile" if [ $retval -ne 0 ]; then + cat "$cp_outfile" + rm "$cp_outfile" echo "got return value $retval from copying ${ARCHIVE_DIR_PREFIX}* from ${host}.${domain_piece}; skipping it." popd continue fi + rm "$cp_outfile" # code below cleans up any archive dirs on the host by hiding them in an # old junk folder. the junk folder can be cleaned up later as desired. -- 2.34.1