3ca715eb50d3c7f3d7e5f8118f1f7b18898b5221
[feisty_meow.git] / scripts / customize / fred / scripts / 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 #function synch_directory_to_target()
21 #{
22 #  local from="$1"; shift
23 #  local to="$1"; shift
24 #
25 #  sep
26 #
27 #  if [ ! -d "$from" ]; then
28 #    echo "skipping synch one missing source directory $from; this is not normal!"
29 #  fi
30 #  if [ ! -d "$to" ]; then
31 #    echo "skipping synch into non-existent directory $to"
32 #  fi
33 #
34 #  echo "synching from $from into $to"
35 #  netcp "$from"/* "$to"/
36 #  if [ $? -ne 0 ]; then
37 #    echo "The synchronization of $from into $to has failed."
38 #    exit 1
39 #  fi
40 #}
41
42 # do all our targets.
43 for currdir in $ARCHIVE_COLLECTIONS_LIST; do
44   synch_directory_to_target "$currdir" "$TARGET_FOLDER/$(basename $currdir)"/
45 #  sep
46 #  echo "synching $currdir..."
47 #  netcp $currdir/* /media/fred/soapboxdrive/$currdir/
48 #  if [ $? -ne 0 ]; then
49 #    echo "The $currdir sync failed."
50 #    exit 1
51 #  fi
52 done
53
54 sep
55
56 echo getting latest fred repositories...
57 pushd "$TARGET_FOLDER"
58 update_source_folders extra_brain
59
60 sep
61
62 echo Updated all expected portions of the targets successfully.
63