starting to look good for general updater
[feisty_meow.git] / scripts / archival / general_updater.sh
1 #!/bin/bash
2
3 # a script that handles synchronization of important assets from the ARCHIVE_COLLECTION_LIST
4 # and the SOURCE_HIERARCHY_LIST onto a backup drive of some sort.  it will only copy folders
5 # if there is a target folder of the appropriate name already on the backup medium.
6
7 source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh"
8 source "$FEISTY_MEOW_SCRIPTS/archival/shared_updater_parts.sh"
9
10 function update_archive_drive()
11 {
12   local target_folder="$1"; shift
13     # where we're backing up to.
14
15   sep
16
17   echo Target drive currently has...
18   ls "$target_folder"
19   if [ $? -ne 0 ]; then
20     echo "The target location '$target_folder' is not mounted currently, so cannot be updated."
21     exit 1
22   fi
23
24   # synch all our targets.
25   for currdir in $ARCHIVE_COLLECTION_LIST; do
26     synch_directory_to_target "$currdir" "$target_folder/$(basename $currdir)"/
27   done
28
29   sep
30
31   # update source code if present.
32   echo getting latest fred repositories...
33   pushd "$target_folder"
34   update_source_folders $SOURCE_HIERARCHY_LIST
35 #hmmm:clean
36 #extra_brain interbrane
37 #need source list
38   
39   sep
40
41   echo Updated all expected portions of the targets successfully.
42 }
43
44