aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--templates/dup.conf.erb3
1 files changed, 2 insertions, 1 deletions
diff --git a/templates/dup.conf.erb b/templates/dup.conf.erb
index 631bf9d..ea5dccf 100644
--- a/templates/dup.conf.erb
+++ b/templates/dup.conf.erb
@@ -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."