From afd07e064cb18684ca402d79a8d41990488f25a8 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Sun, 12 Dec 2010 16:14:40 -0200 Subject: Doing error handling right --- templates/dup.conf.erb | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'templates') diff --git a/templates/dup.conf.erb b/templates/dup.conf.erb index c0b689d..ee58d2f 100644 --- a/templates/dup.conf.erb +++ b/templates/dup.conf.erb @@ -34,7 +34,15 @@ else # have greater precedence; see duplicity(1) for more info duplicity -v6 --full-if-older-than $FULL_IF_OLDER_THAN \ --tempdir $TMP --encrypt-key $ENCRYPT_KEY --sign-key $SIGN_KEY \ - --exclude $TMP $EXCLUDE $INCLUDE --exclude '**' / file:///$BACKUP_FOLDER || exit 1 + --exclude $TMP $EXCLUDE $INCLUDE --exclude '**' / file:///$BACKUP_FOLDER + + if [ "$?" != "0" ]; then + fatal "Duplicity backup failed." + fi duplicity remove-older-than $REMOVE_OLDER_THAN file:///$BACKUP_FOLDER --force || exit 1 + + if [ "$?" != "0" ]; then + fatal "Removal of old backups failed." + fi fi -- cgit v1.2.3