]> gitweb.fluxo.info Git - puppet-backup.git/commitdiff
Doing error handling right
authorSilvio Rhatto <rhatto@riseup.net>
Sun, 12 Dec 2010 18:14:40 +0000 (16:14 -0200)
committerSilvio Rhatto <rhatto@riseup.net>
Sun, 12 Dec 2010 18:14:40 +0000 (16:14 -0200)
templates/dup.conf.erb

index c0b689d963e8b9c42ebf2d1a5ac4e738d3d2e76c..ee58d2f18f5db5bfcb91ecbcaf3c342b0c30abc8 100644 (file)
@@ -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