X-Git-Url: https://feistymeow.org/gitweb/?a=blobdiff_plain;f=scripts%2Farchival%2Fgeneral_updater.sh;h=918671d8116333c436975ce9fa832b67d3230665;hb=53b84142d889ff4fdf2d135a9c022d50e34ad211;hp=3ae2d1681839e47959a0380941f19bf1737afbd7;hpb=a57a1eb6488a758c9f68b6a32e3d846899163a9f;p=feisty_meow.git diff --git a/scripts/archival/general_updater.sh b/scripts/archival/general_updater.sh index 3ae2d168..918671d8 100644 --- a/scripts/archival/general_updater.sh +++ b/scripts/archival/general_updater.sh @@ -1,7 +1,7 @@ #!/bin/bash -# a script that handles synchronization of important assets from the ARCHIVE_COLLECTION_LIST -# and the SOURCE_HIERARCHY_LIST onto a backup drive of some sort. it will only copy folders +# a script that handles synchronization of important assets from the MAJOR_ARCHIVE_SOURCES +# and the SOURCECODE_HIERARCHY_LIST onto a backup drive of some sort. it will only copy folders # if there is a target folder of the appropriate name already on the backup medium. source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh" @@ -11,6 +11,7 @@ source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh" function update_source_folders() { folder="$1"; shift + sep if [ ! -d "$folder" ]; then echo "The folder '$folder' does not exist, so skipping repository update there." return; @@ -19,14 +20,15 @@ function update_source_folders() pushd "$folder" if [ $? -ne 0 ]; then echo Changing to the folder $folder failed. - exit 1 + return 1 fi bash "$FEISTY_MEOW_SCRIPTS/rev_control/rcheckin.sh" if [ $? -ne 0 ]; then echo Checking out the latest codes has failed somehow for $folder. - exit 1 + return 1 fi popd + sep } # this attempts to copy all the contents in a folder called "from" into a folder @@ -40,26 +42,26 @@ function synch_directory_to_target() sep if [ ! -d "$from" ]; then - echo "skipping synch on missing source directory $from; this is not normal!" - exit 1 + echo "skipping synch on missing source directory: ${from}" + return 0 fi if [ ! -d "$to" ]; then - echo "skipping synch into non-existent directory $to" - return + echo "skipping synch into non-existent target directory $to" + return 0 fi echo "synching from $from into $to" netcp "$from"/* "$to"/ if [ $? -ne 0 ]; then echo "The synchronization of $from into $to has failed." - exit 1 + return 1 fi } # the uber controller method that does the "hard" work of updating. -# any items from the ARCHIVE_COLLECTION_LIST that are on the target will be +# any items from the MAJOR_ARCHIVE_SOURCES that are on the target will be # updated. any items found on the target matching the members of the -# SOURCE_COLLECTION_LIST will be treated as code hierarchies and updated. +# SOURCECODE_HIERARCHY_LIST will be treated as code hierarchies and updated. function update_archive_drive() { local target_folder="$1"; shift # where we're backing up to. @@ -71,11 +73,11 @@ function update_archive_drive() ls "$target_folder" if [ $? -ne 0 ]; then echo "The target location '$target_folder' is not mounted currently, so cannot be updated." - exit 1 + return 1 fi # synch all our targets. - for currdir in $ARCHIVE_COLLECTION_LIST; do + for currdir in $MAJOR_ARCHIVE_SOURCES; do synch_directory_to_target "$currdir" "$target_folder/$(basename $currdir)"/ done @@ -84,7 +86,7 @@ function update_archive_drive() # update source code if present. echo getting latest fred repositories... pushd "$target_folder" - for currdir in $SOURCE_HIERARCHY_LIST; do + for currdir in $SOURCECODE_HIERARCHY_LIST; do update_source_folders $currdir done @@ -92,6 +94,8 @@ function update_archive_drive() echo successfully updated all expected portions of the target drive at: echo " $target_folder" + echo + popd }