From 8b5e0741dd3530a6779c73e2b162d68d4d2d09b6 Mon Sep 17 00:00:00 2001 From: Chris Koeritz Date: Tue, 3 Jul 2012 16:26:35 -0400 Subject: [PATCH] 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. --- scripts/database/serene_backer_upper.sh | 32 +++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 scripts/database/serene_backer_upper.sh 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" + + -- 2.34.1