From d3c4a0219499000a9b032ddfdb6885deb8bb4123 Mon Sep 17 00:00:00 2001 From: "Fred T. Hamster" Date: Wed, 13 Nov 2024 16:01:25 -0500 Subject: [PATCH] nicely updated does the current most used set of machines at its, plus moves the snagged archives out of the way into uniquely named old junk folders. --- .../fred/scripts/jobby/archie_grabber.sh | 50 ++++++++++++------- 1 file changed, 32 insertions(+), 18 deletions(-) diff --git a/scripts/customize/fred/scripts/jobby/archie_grabber.sh b/scripts/customize/fred/scripts/jobby/archie_grabber.sh index f58b54a1..609c73e9 100644 --- a/scripts/customize/fred/scripts/jobby/archie_grabber.sh +++ b/scripts/customize/fred/scripts/jobby/archie_grabber.sh @@ -15,18 +15,26 @@ function grab_archies() for host in $host_list; do mkdir -p ${host}.${domain_piece} pushd ${host}.${domain_piece} - netcp ${host}.${domain_piece}:${ARCHIVE_DIR_PREFIX}* . + local cp_outfile="$(mktemp /tmp/archie_grabber.XXXXXX)" + netcp ${host}.${domain_piece}:${ARCHIVE_DIR_PREFIX}* . &> "$cp_outfile" retval=$? +#hmmm: could display output on error. + rm "$cp_outfile" if [ $retval -ne 0 ]; then - echo "Error $retval returned from copying ${ARCHIVE_DIR_PREFIX}* from ${host}.${domain_piece}" + echo "got return value $retval from copying ${ARCHIVE_DIR_PREFIX}* from ${host}.${domain_piece}; skipping it." popd continue fi - ssh ${host}.${domain_piece} '{ \ -echo hello; \ -echo "howdy ho!"; \ -echo more stuff here.; \ -}' + # the tricky code below just cleans up any archive dirs on the host by hiding them + # under an old junk folder. that can be cleaned up later as desired. + ssh ${host}.${domain_piece} bash <