df5921c0989931df3e8c86a03b90212ac7f49e02
[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/functions.sh"
6
7 function get_source()
8 {
9   folder="$1"; shift
10   echo getting latest codes in $folder...
11   pushd "$folder"
12   if [ $? -ne 0 ]; then
13     echo Changing to the folder $folder failed.
14     exit 1
15   fi
16   bash "$FEISTY_MEOW_SCRIPTS/rev_control/rev_checkin.sh"
17   if [ $? -ne 0 ]; then
18     echo Checking out the latest codes has failed somehow for $folder.
19     exit 1
20   fi
21   popd
22 }
23
24 sep
25
26 ls /media/fred/soapboxdrive
27 if [ $? -ne 0 ]; then
28   echo The soapbox drive is not mounted currently, so cannot be updated.
29   exit 1
30 fi
31
32 sep
33
34 echo synching walrus...
35 rsync -av /z/walrus/* /media/fred/soapboxdrive/walrus/
36 if [ $? -ne 0 ]; then
37   echo The walrus sync failed.
38   exit 1
39 fi
40
41 sep
42
43 echo synching musix...
44 rsync -av /z/musix/* /media/fred/soapboxdrive/musix/
45 if [ $? -ne 0 ]; then
46   echo The musix sync failed.
47   exit 1
48 fi
49
50 sep
51
52 echo getting latest fred codes...
53 pushd /media/fred/soapboxdrive
54 get_source extra_brain
55
56 sep
57
58 echo getting latest gffs codes...
59 get_source gffs
60 popd
61
62 sep
63
64 echo Updated all portions of the soapbox drive successfully.
65