From: Fred Hamster Date: Sat, 14 Dec 2024 23:12:45 +0000 (-0500) Subject: close to perfection-ish with cleanup X-Git-Tag: 2.140.189^2~78 X-Git-Url: https://feistymeow.org/gitweb/?a=commitdiff_plain;h=43912a805ca123cfc2207d798ce3ba08805f55e8;p=feisty_meow.git close to perfection-ish with cleanup seems to be working. --- diff --git a/scripts/customize/fred/scripts/jobby/archie_grabber.sh b/scripts/customize/fred/scripts/jobby/archie_grabber.sh index 432ead0b..9995a287 100644 --- a/scripts/customize/fred/scripts/jobby/archie_grabber.sh +++ b/scripts/customize/fred/scripts/jobby/archie_grabber.sh @@ -1,15 +1,21 @@ #!/bin/bash # grabs a set of archives from a set of machines. -# not tuned for re-use very much yet. -#hmmm: could re-base this script on the newly available host_strider, which offers services this could really use. +#hmmm: not tuned for re-use very much yet. +# but this idea could be used for our home machines too... given some good parameter management. source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh" -# the archive directories will be known by their odd naming, which starts with the below. -ARCHIVE_DIR_PREFIX="z_arch" +if [ -z "$ARCHIVE_DIR_PREFIX" ]; then + # the archive directories will be known by their odd naming, which starts with the below. + # but we respect if people want to override that default archive directory name. + ARCHIVE_DIR_PREFIX="z_arch" +fi +# looks for archive directories within a DNS domain for a set of hosts. +# if any archive dirs are found, they are copied to the local host and +# then moved out of the way on the remote host. function grab_archies() { local domain_piece="$1"; shift @@ -20,7 +26,7 @@ function grab_archies() local cp_outfile="$(mktemp /tmp/archie_grabber.XXXXXX)" netcp ${host}.${domain_piece}:${ARCHIVE_DIR_PREFIX}* . &> "$cp_outfile" retval=$? -#hmmm: could display output on error. +#hmmm: could display the output on error. and we have a function for that... rm "$cp_outfile" if [ $retval -ne 0 ]; then echo "got return value $retval from copying ${ARCHIVE_DIR_PREFIX}* from ${host}.${domain_piece}; skipping it." @@ -34,31 +40,21 @@ function grab_archies() # moved out of the way before the next run. host_strider $DATA_GRAVE_SHUFFLE_COMMAND ${domain_piece} ${host} -#old code -# # 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 < $DATA_GRAVE_SHUFFLE_COMMAND -#hmmm: got the script done above. need to start calling the host strider for this. - -#### +################ # these hosts are all in the ITS domain... @@ -92,7 +87,7 @@ grab_archies "$domain" "$hostlist" hostlist="tower " grab_archies "$domain" "$hostlist" -#### +################ # these hosts are in the storage domain... @@ -100,7 +95,7 @@ domain="storage.virginia.edu" hostlist="admin03 admin-hsz02-s admin-lab nasman02-s " grab_archies "$domain" "$hostlist" -#### +################ popd