From a783a7724c070dff5bd86406e5fc757fe21540be Mon Sep 17 00:00:00 2001 From: Fred Hamster Date: Mon, 16 Dec 2024 19:09:16 -0500 Subject: [PATCH] tastycakes, seems to be working? --- .../fred/scripts/jobby/archie_grabber_uva.sh | 31 ++++++++++++++----- .../fred/scripts/jobby/uva_strider.sh | 13 ++------ 2 files changed, 26 insertions(+), 18 deletions(-) diff --git a/scripts/customize/fred/scripts/jobby/archie_grabber_uva.sh b/scripts/customize/fred/scripts/jobby/archie_grabber_uva.sh index 32bdff83..ce088056 100644 --- a/scripts/customize/fred/scripts/jobby/archie_grabber_uva.sh +++ b/scripts/customize/fred/scripts/jobby/archie_grabber_uva.sh @@ -4,6 +4,8 @@ source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh" +################ + 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. @@ -20,11 +22,11 @@ export COPY_TARGET_TOP="$HOME/grabbing_archies" mkdir -p "$COPY_TARGET_TOP" export ARCHIVE_SNAGGER_COMMAND="$(mktemp "$TMP/archive_snagger.sh.XXXXXX")" -echo '\ -#!/usr/bin/env bash +echo '#!/usr/bin/env bash # copies the archives we find in the remote home for the user which start with the expected prefix. hostname="$1"; shift ARCHIVE_DIR_PREFIX="'$ARCHIVE_DIR_PREFIX'" +source "$FEISTY_MEOW_APEX/scripts/core/launch_feisty_meow.sh" pushd "$COPY_TARGET_TOP" mkdir -p "${hostname}" pushd "${hostname}" @@ -40,10 +42,14 @@ popd exit $retval ' > $ARCHIVE_SNAGGER_COMMAND +#s +#echo archive snagger: +#cat $ARCHIVE_SNAGGER_COMMAND +#s + # write a script that we'll run remotely to clean up after we get a copy of the archives. export DATA_GRAVE_SHUFFLE_COMMAND="$(mktemp "$TMP/data_engraver.sh.XXXXXX")" -echo '\ -#!/usr/bin/env bash +echo '#!/usr/bin/env bash # moves the newly copied archives into a junk folder. ARCHIVE_DIR_PREFIX="'$ARCHIVE_DIR_PREFIX'" DATA_GRAVE="$(mktemp -d $HOME/old_junk.XXXXXX)" @@ -53,24 +59,33 @@ echo "moving old $ARCHIVE_DIR_PREFIX* folders into $DATA_GRAVE" mv $ARCHIVE_DIR_PREFIX* $DATA_GRAVE ' > $DATA_GRAVE_SHUFFLE_COMMAND +#s +#echo data engraver: +#cat $DATA_GRAVE_SHUFFLE_COMMAND +#s + export LOCAL_CLEANER_COMMAND="$(mktemp "$TMP/post_copy_local_cleaner.sh.XXXXXX")" -echo '\ -#!/usr/bin/env bash +echo '#!/usr/bin/env bash # the last step is to clean up anything for this transfer that we want to dump. hostname="$1"; shift ARCHIVE_DIR_PREFIX="'$ARCHIVE_DIR_PREFIX'" echo "no steps for cleanup yet..." ' > $LOCAL_CLEANER_COMMAND +#s +#echo local cleanup: +#cat $LOCAL_CLEANER_COMMAND +#s + ################ # do our thing with the uva strider to get any archives... -uva strider "$ARCHIVE_SNAGGER_COMMAND" "$DATA_GRAVE_SHUFFLE_COMMAND" "$LOCAL_CLEANER_COMMAND" +uva_strider "$ARCHIVE_SNAGGER_COMMAND" "$DATA_GRAVE_SHUFFLE_COMMAND" "$LOCAL_CLEANER_COMMAND" ################ # clean-up for our own script here... -rm "$ARCHIVE_SNAGGER_COMMAND" "$DATA_GRAVE_SHUFFLE_COMMAND" "$LOCAL_CLEANER_COMMAND" +#rm "$ARCHIVE_SNAGGER_COMMAND" "$DATA_GRAVE_SHUFFLE_COMMAND" "$LOCAL_CLEANER_COMMAND" ################ diff --git a/scripts/customize/fred/scripts/jobby/uva_strider.sh b/scripts/customize/fred/scripts/jobby/uva_strider.sh index 3b39bfff..3cfc4fce 100644 --- a/scripts/customize/fred/scripts/jobby/uva_strider.sh +++ b/scripts/customize/fred/scripts/jobby/uva_strider.sh @@ -24,7 +24,7 @@ function instigate_remote_calls() # first we call our initialization process. echo "invoking local initialization operation '$init_op'..." - squelch_unless_error bash "$init_op" + squelch_unless_error bash "$init_op" "${host}.${domain_piece}" retval=$? if [ $retval -ne 0 ]; then echo "got return value $retval from initialization script '$init_op' for ${host}.${domain_piece}; skipping it." @@ -33,7 +33,7 @@ function instigate_remote_calls() # now we make the remote call by relying on the host strider. echo "invoking remote action operation '$remote_op'..." - squelch_unless_error host_strider "${remote_op}" "${domain_piece}" "${host}" + squelch_unless_error bash $FEISTY_MEOW_SCRIPTS/core/host_strider.sh "${remote_op}" "${domain_piece}" "${host}" retval=$? if [ $retval -ne 0 ]; then echo "got return value $retval from remote action script '$remote_op' on ${host}.${domain_piece}; skipping it." @@ -42,7 +42,7 @@ function instigate_remote_calls() # then invoke the clean-up call to get things right again on the local host. echo "invoking local clean-up operation '$cleanup_op'..." - squelch_unless_error bash "$cleanup_op" + squelch_unless_error bash "$cleanup_op" "${host}.${domain_piece}" retval=$? if [ $retval -ne 0 ]; then echo "got return value $retval from clean-up script '$cleanup_op' for ${host}.${domain_piece}; skipping it." @@ -81,13 +81,6 @@ fi ################ -#while testing, we limit the blast zone... -domain="its.virginia.edu" -hostlist="idpdev01 " -instigate_remote_calls "$init_op" "$remote_op" "$cleanup_op" "$domain" "$hostlist" -echo BAILING -exit 1 - # these hosts are all in the ITS domain... domain="its.virginia.edu" -- 2.34.1