3 function check_if_failed()
11 function exit_if_failed()
19 function synch_to_backup()
21 local source="$1"; shift
22 local dest="$1"; shift
23 if [ -z "$source" -o -z "$dest" ]; then
24 echo synch_to_backup function requires a source and a target folder to synch.
27 echo "Synchronizing $source into $dest."
28 #hmmm: temporary measure until top-level dir bug fixed in synch_files app.
29 if [ ! -d "$dest" ]; then
32 echo "FAILed to make target directory: $dest"
36 synch_files "$source" "$dest"
37 check_if_failed "synching $source to $dest"
40 # just undo it first, to try to be sure we know we are mounted properly later.
41 umount /z/backup &>/dev/null
43 # now saddle up the backup.
45 exit_if_failed "mounting backup folder"
47 # we should always be synching to an existing set in there. make sure they exist.
48 # for the first ever backup, this is not a good check...
49 #test -d /z/backup/etc -a -d /z/backup/home
50 #exit_if_failed "testing presence of prior backup"
54 synch_to_backup /etc /z/backup/etc/
58 for subdir in albums deepcore drupal fred git sharedspam sim svn trac ; do
59 synch_to_backup /home/$subdir /z/backup/home/$subdir
64 synch_to_backup /var/lib/mailman /z/backup/var/lib/mailman
69 exit_if_failed "unmounting backup folder"