From: Chris Koeritz Date: Sun, 12 Nov 2017 14:22:40 +0000 (-0500) Subject: starting to look good for general updater X-Git-Tag: 2.140.98^2~4^2~13^2~5 X-Git-Url: https://feistymeow.org/gitweb/?a=commitdiff_plain;h=f4c16b2e2c288c8c37bc36e0446c0141afd8a363;p=feisty_meow.git starting to look good for general updater --- diff --git a/scripts/archival/general_updater.sh b/scripts/archival/general_updater.sh new file mode 100644 index 00000000..2af8e568 --- /dev/null +++ b/scripts/archival/general_updater.sh @@ -0,0 +1,44 @@ +#!/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 +# if there is a target folder of the appropriate name already on the backup medium. + +source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh" +source "$FEISTY_MEOW_SCRIPTS/archival/shared_updater_parts.sh" + +function update_archive_drive() +{ + local target_folder="$1"; shift + # where we're backing up to. + + sep + + echo Target drive currently has... + ls "$target_folder" + if [ $? -ne 0 ]; then + echo "The target location '$target_folder' is not mounted currently, so cannot be updated." + exit 1 + fi + + # synch all our targets. + for currdir in $ARCHIVE_COLLECTION_LIST; do + synch_directory_to_target "$currdir" "$target_folder/$(basename $currdir)"/ + done + + sep + + # update source code if present. + echo getting latest fred repositories... + pushd "$target_folder" + update_source_folders $SOURCE_HIERARCHY_LIST +#hmmm:clean +#extra_brain interbrane +#need source list + + sep + + echo Updated all expected portions of the targets successfully. +} + + diff --git a/scripts/core/variables.sh b/scripts/core/variables.sh index a937d05d..351d23c6 100644 --- a/scripts/core/variables.sh +++ b/scripts/core/variables.sh @@ -228,7 +228,10 @@ define_yeti_variable DEFAULT_FEISTYMEOW_ORG_DIR=/opt/feistymeow.org # the archive collections list is a set of directories that are major # repositories of data which can be synched to backup drives. - define_yeti_variable ARCHIVE_COLLECTIONS_LIST= + define_yeti_variable ARCHIVE_COLLECTION_LIST= + # the source collections list is a set of directories that indicate they + # harbor a lot of source code underneath. + define_yeti_variable SOURCE_HIERARCHY_LIST= # initializes the feisty meow build variables, if possible. function initialize_build_variables() diff --git a/scripts/customize/fred/fred_variables.sh b/scripts/customize/fred/fred_variables.sh index 4c9c0d90..58375868 100644 --- a/scripts/customize/fred/fred_variables.sh +++ b/scripts/customize/fred/fred_variables.sh @@ -18,7 +18,9 @@ if [ -z "$USER_CUSTOMIZATIONS_LOADED" ]; then REPOSITORY_LIST+=" cloud ebooks web " # adds our locally relevant archive folders into the list to be synched. - ARCHIVE_COLLECTIONS_LIST+="/z/basement /z/imaginations /z/musix /z/toaster /z/walrus" + ARCHIVE_COLLECTION_LIST+="/z/basement /z/imaginations /z/musix /z/toaster /z/walrus" + # our set of known source hierarchy folder names. + SOURCE_HIERARCHY_LIST="codebarn extra_brain interbrane" # point to our local certificate for ssh usage. export SVN_SSH="ssh -i $HOME/.ssh/id_dsa_sourceforge" diff --git a/scripts/customize/fred/scripts/disk_synch/compare_soapbox.sh b/scripts/customize/fred/scripts/disk_synch/compare_soapbox.sh index 8dd3f44a..cd02a888 100644 --- a/scripts/customize/fred/scripts/disk_synch/compare_soapbox.sh +++ b/scripts/customize/fred/scripts/disk_synch/compare_soapbox.sh @@ -17,6 +17,8 @@ function compare_archives_with_target() done } +#hmmm: generalize this one also. + compare_archives_with_target /media/fred/soapboxdrive sep diff --git a/scripts/customize/fred/scripts/disk_synch/update_fredmusicprime.sh b/scripts/customize/fred/scripts/disk_synch/update_fredmusicprime.sh index 44597545..9cd75dec 100644 --- a/scripts/customize/fred/scripts/disk_synch/update_fredmusicprime.sh +++ b/scripts/customize/fred/scripts/disk_synch/update_fredmusicprime.sh @@ -18,7 +18,7 @@ if [ $? -ne 0 ]; then fi # synch all our targets. -for currdir in $ARCHIVE_COLLECTIONS_LIST; do +for currdir in $ARCHIVE_COLLECTION_LIST; do synch_directory_to_target "$currdir" "$TARGET_FOLDER/$(basename $currdir)"/ done @@ -27,7 +27,7 @@ sep # update source code if present. echo getting latest fred repositories... pushd "$TARGET_FOLDER" -update_source_folders extra_brain +update_source_folders $SOURCE_HIERARCHY_LIST sep diff --git a/scripts/customize/fred/scripts/disk_synch/update_soapbox.sh b/scripts/customize/fred/scripts/disk_synch/update_soapbox.sh index f2208f53..5e1b98cc 100644 --- a/scripts/customize/fred/scripts/disk_synch/update_soapbox.sh +++ b/scripts/customize/fred/scripts/disk_synch/update_soapbox.sh @@ -18,7 +18,7 @@ if [ $? -ne 0 ]; then fi # synch all our targets. -for currdir in $ARCHIVE_COLLECTIONS_LIST; do +for currdir in $ARCHIVE_COLLECTION_LIST; do synch_directory_to_target "$currdir" "$TARGET_FOLDER/$(basename $currdir)"/ done @@ -27,8 +27,9 @@ sep # update source code if present. echo getting latest fred repositories... pushd "$TARGET_FOLDER" -update_source_folders extra_brain - +for currdir in $SOURCE_HIERARCHY_LIST; do + update_source_folders "$curr_dir" +done sep echo Updated all expected portions of the targets successfully.