updated kopia state

This commit is contained in:
Paul 2024-01-27 10:41:56 +01:00
parent 6ad129f341
commit 03c24893d0

View File

@ -11,7 +11,6 @@ from subprocess import Popen, PIPE
KOPIA_PASSWORD="{{ params.password|default('') }}" KOPIA_PASSWORD="{{ params.password|default('') }}"
KOPIA_CONFIG_PATH="/etc/kopia/{{ name }}/repo.config" KOPIA_CONFIG_PATH="/etc/kopia/{{ name }}/repo.config"
KOPIA_KEEP_LAST=7
ENV = { ENV = {
"KOPIA_PASSWORD": KOPIA_PASSWORD, "KOPIA_PASSWORD": KOPIA_PASSWORD,
@ -43,7 +42,7 @@ def init(mode="filesystem", path=None, bucket=None, prefix=None, gateway=None, r
def set_policy(compression="zstd"): def set_policy(compression="zstd"):
cmd_policy = f"kopia policy set --global --config-file={KOPIA_CONFIG_PATH} --compression={compression} --keep-latest={KOPIA_KEEP_LAST} --keep-hourly 0 --keep-daily {{ params.keep_daily|default(7) }} --keep-weekly {{ params.keep_weekly|default(4) }} --keep-monthly {{ params.keep_monthly|default(6) }} --keep-annual 0 --one-file-system=true" cmd_policy = f"kopia policy set --global --config-file={KOPIA_CONFIG_PATH} --compression={compression} --keep-latest={{ params.keep_latest|default(7) }} --keep-hourly 0 --keep-daily {{ params.keep_daily|default(7) }} --keep-weekly {{ params.keep_weekly|default(4) }} --keep-monthly {{ params.keep_monthly|default(6) }} --keep-annual 0 --one-file-system=true"
run_policy = Popen(cmd_policy, shell=True, stdout=PIPE, stderr=PIPE) run_policy = Popen(cmd_policy, shell=True, stdout=PIPE, stderr=PIPE)
run_policy.wait() run_policy.wait()
if run_policy.returncode == 0: if run_policy.returncode == 0: