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 \
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."