]> gitweb.fluxo.info Git - puppet-backup.git/commitdiff
changing duplicity cleanup to occur before the actual backup
authordrebs <drebs@riseup.net>
Fri, 6 Jan 2012 14:25:09 +0000 (12:25 -0200)
committerdrebs <drebs@riseup.net>
Fri, 6 Jan 2012 14:25:09 +0000 (12:25 -0200)
templates/dup.conf.erb

index 631bf9d5b30d3e2ec72704e7998cb8c79df0992d..ea5dccf9731214ee72e0cc6aee1002d9c2f406ef 100644 (file)
@@ -31,6 +31,8 @@ mkdir -p $BACKUP_FOLDER
 if [ "$1" == "--check" ]; then
   duplicity collection-status file:///$BACKUP_FOLDER
 else
+  # cleanup any previous broken backups
+  duplicity cleanup file:///$BACKUP_FOLDER --force
   # it's important to let $EXCLUDE come before $INCLUDE to
   # have greater precedence; see duplicity(1) for more info
   duplicity -v6 --full-if-older-than $FULL_IF_OLDER_THAN                    \
@@ -43,7 +45,6 @@ else
 
   duplicity remove-older-than $REMOVE_OLDER_THAN file:///$BACKUP_FOLDER --force || exit 1
   duplicity remove-all-but-n-full $REMOVE_ALL_BUT_N_FULL file:///$BACKUP_FOLDER --force || exit 1
-  duplicity cleanup file:///$BACKUP_FOLDER --force || exit 1
 
   if [ "$?" != "0" ]; then
     fatal "Removal of old backups failed."