From: Chris Koeritz Date: Tue, 3 Jul 2012 20:26:35 +0000 (-0400) Subject: script to backup home and etc to off-machine storage. X-Git-Tag: 2.140.90~1295 X-Git-Url: https://feistymeow.org/gitweb/?a=commitdiff_plain;h=8b5e0741dd3530a6779c73e2b162d68d4d2d09b6;p=feisty_meow.git script to backup home and etc to off-machine storage. does not work yet because synch_files app is not able to handle that massive of a synch on the home folder. --- diff --git a/scripts/database/serene_backer_upper.sh b/scripts/database/serene_backer_upper.sh new file mode 100644 index 00000000..d2018061 --- /dev/null +++ b/scripts/database/serene_backer_upper.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +function check_if_failed() +{ + if [ $? -ne 0 ]; then + echo Step failed: $* + exit 1 + fi +} + +# just undo it first, to try to be sure we know we are mounted properly later. +umount /z/backup &>/dev/null + +# now saddle up the backup. +mount /z/backup/ +check_if_failed "mounting backup folder" + +# we should always be synching to an existing set in there. make sure they exist. +# for the first ever backup, this is not a good check... +test -d /z/backup/etc -a -d /z/backup/home +check_if_failed "testing presence of prior backup" + +synch_files /etc /z/backup/etc/ +check_if_failed "synching etc to backup" + +synch_files /home /z/backup/home/ +check_if_failed "synching home to backup" + +umount /z/backup/ +check_if_failed "unmounting backup folder" + +