diff --git a/handlers/borg.in b/handlers/borg.in index d1c8a7802383523e39fcaaf174342828f5867636..f98a2446c145b0779986bb4a0392bdd10ab4b7d7 100644 --- a/handlers/borg.in +++ b/handlers/borg.in @@ -151,17 +151,18 @@ fi ### REMOVE OLD BACKUPS ### # borg prune -prunestr="borg prune --keep-hourly $keephourly --keep-daily $keepdaily --keep-weekly $keepweekly --keep-monthly $keepmonthly $execstr_repository" -debug "$prunestr" - -if [ $test = 0 ] && [ "$prune" == "yes" ]; then - output="`su -c "$prunestr" 2>&1`" - if [ $? = 0 ]; then - debug $output - info "Removing old backups succeeded." - else - warning $output - warning "Failed removing old backups." +if [ "$prune" == "yes" ]; then + prunestr="borg prune --keep-hourly $keephourly --keep-daily $keepdaily --keep-weekly $keepweekly --keep-monthly $keepmonthly $execstr_repository" + debug "$prunestr" + if [ $test = 0 ]; then + output="`su -c "$prunestr" 2>&1`" + if [ $? = 0 ]; then + debug $output + info "Removing old backups succeeded." + else + warning $output + warning "Failed removing old backups." + fi fi fi