From 38ce615625c5acfc5ae1d5dae0e3a7fbd8e6d698 Mon Sep 17 00:00:00 2001 From: drebs Date: Fri, 6 Jan 2012 12:25:09 -0200 Subject: changing duplicity cleanup to occur before the actual backup --- templates/dup.conf.erb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'templates') 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." -- cgit v1.2.3