5e1b98cc88806b82177763810eb22ef4fd1bf2db
[feisty_meow.git] / scripts / customize / fred / scripts / archival / update_soapbox.sh
1 #!/bin/bash
2
3 # updates my little 1 TB "soapbox" style usb drive with items that it should contain.
4
5 source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh"
6 source "$FEISTY_MEOW_SCRIPTS/archival/shared_updater_parts.sh"
7
8 # where we're backing up to.
9 TARGET_FOLDER="/media/fred/soapboxdrive"
10
11 sep
12
13 echo Target drive currently has...
14 ls "$TARGET_FOLDER"
15 if [ $? -ne 0 ]; then
16   echo "The target location '$TARGET_FOLDER' is not mounted currently, so cannot be updated."
17   exit 1
18 fi
19
20 # synch all our targets.
21 for currdir in $ARCHIVE_COLLECTION_LIST; do
22   synch_directory_to_target "$currdir" "$TARGET_FOLDER/$(basename $currdir)"/
23 done
24
25 sep
26
27 # update source code if present.
28 echo getting latest fred repositories...
29 pushd "$TARGET_FOLDER"
30 for currdir in $SOURCE_HIERARCHY_LIST; do
31   update_source_folders "$curr_dir"
32 done
33 sep
34
35 echo Updated all expected portions of the targets successfully.
36