From 0267db247e4cd6ad99d34af34ae9339f11391879 Mon Sep 17 00:00:00 2001 From: Ruakij Date: Sun, 1 Nov 2026 09:56:44 +0000 Subject: [PATCH] backup: drop nonexistent --clear-retention flag from retention helper --- kopia_backup/templates/kopia-backup.j2 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/kopia_backup/templates/kopia-backup.j2 b/kopia_backup/templates/kopia-backup.j2 index c71c73f..43b1cd9 100644 --- a/kopia_backup/templates/kopia-backup.j2 +++ b/kopia_backup/templates/kopia-backup.j2 @@ -53,11 +53,11 @@ ignore {{ i.key | quote }} {{ i.value | map('quote') | join(' ') }} {% set retentions = kopia_backup.retention | default({}) | dict2items | rejectattr('value', 'none') | list %} {% if retentions %} -# Per-source retention overrides, applied as a whole (--clear-retention runs after the keep flags within one call). +# Per-source retention overrides, applied as a whole. A keep flag of 0 means "inherit", +# so setting all four flags explicitly fully defines the retention for the path. retention() { local path=$1; shift - kopia policy set "$path" --clear-retention >/dev/null 2>&1 && - kopia policy set "$path" "$@" >/dev/null 2>&1 || + kopia policy set "$path" "$@" >/dev/null 2>&1 || { echo "setting the retention of $path failed" >&2; failed=1; } } {% for r in retentions %}