diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2010-12-12 16:14:40 -0200 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2010-12-12 16:14:40 -0200 |
commit | afd07e064cb18684ca402d79a8d41990488f25a8 (patch) | |
tree | 369621c1c5bffa7702847c738285f8f916c8edce /templates | |
parent | 72a74de6302cce0ac510ec0fe139a1ae26ca07c6 (diff) | |
download | puppet-backup-afd07e064cb18684ca402d79a8d41990488f25a8.tar.gz puppet-backup-afd07e064cb18684ca402d79a8d41990488f25a8.tar.bz2 |
Doing error handling right
Diffstat (limited to 'templates')
-rw-r--r-- | templates/dup.conf.erb | 10 |
1 files changed, 9 insertions, 1 deletions
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 |