From 1986d0115fe71ba1cd866950a9aeb1841121fb15 Mon Sep 17 00:00:00 2001 From: Clemens Geibel Date: Fri, 15 Jul 2022 13:23:45 +0200 Subject: [PATCH] Adjusted remove policy for restic on ubuntu20 --- infrastructure/docker/image/resources/file-functions.sh | 8 ++++---- infrastructure/docker/image/resources/pg-functions.sh | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/infrastructure/docker/image/resources/file-functions.sh b/infrastructure/docker/image/resources/file-functions.sh index d573503..798147e 100644 --- a/infrastructure/docker/image/resources/file-functions.sh +++ b/infrastructure/docker/image/resources/file-functions.sh @@ -17,11 +17,11 @@ function backup-directory() { then restic -v -r ${RESTIC_REPOSITORY}/files unlock --cleanup-cache cd ${directory} && restic -v -r ${RESTIC_REPOSITORY}/files backup . - restic -v -r ${RESTIC_REPOSITORY}/files forget --keep-last 1 --keep-within ${RESTIC_DAYS_TO_KEEP}d --keep-within-monthly ${RESTIC_MONTHS_TO_KEEP}m --prune + restic -v -r ${RESTIC_REPOSITORY}/files forget --keep-last 1 --keep-daily ${RESTIC_DAYS_TO_KEEP} --keep-monthly ${RESTIC_MONTHS_TO_KEEP} --prune else restic -v -r ${RESTIC_REPOSITORY}/files unlock --cleanup-cache --cacert ${CERTIFICATE_FILE} cd ${directory} && restic -v -r ${RESTIC_REPOSITORY}/files backup . --cacert ${CERTIFICATE_FILE} - restic -v -r ${RESTIC_REPOSITORY}/files forget --keep-last 1 --keep-within ${RESTIC_DAYS_TO_KEEP}d --keep-within-monthly ${RESTIC_MONTHS_TO_KEEP}m --prune --cacert ${CERTIFICATE_FILE} + restic -v -r ${RESTIC_REPOSITORY}/files forget --keep-last 1 --keep-daily ${RESTIC_DAYS_TO_KEEP} --keep-monthly ${RESTIC_MONTHS_TO_KEEP} --prune --cacert ${CERTIFICATE_FILE} fi } @@ -33,11 +33,11 @@ function backup-fs-from-directory() { then restic -v -r ${RESTIC_REPOSITORY}/files unlock --cleanup-cache cd ${directory} && restic -v -r ${RESTIC_REPOSITORY}/files backup $@ - restic -v -r ${RESTIC_REPOSITORY}/files forget --keep-last 1 --keep-within ${RESTIC_DAYS_TO_KEEP}d --keep-within-monthly ${RESTIC_MONTHS_TO_KEEP}m --prune + restic -v -r ${RESTIC_REPOSITORY}/files forget --keep-last 1 --keep-daily ${RESTIC_DAYS_TO_KEEP} --keep-monthly ${RESTIC_MONTHS_TO_KEEP} --prune else restic -v -r ${RESTIC_REPOSITORY}/files unlock --cleanup-cache --cacert ${CERTIFICATE_FILE} cd ${directory} && restic -v -r ${RESTIC_REPOSITORY}/files backup $@ --cacert ${CERTIFICATE_FILE} - restic -v -r ${RESTIC_REPOSITORY}/files forget --keep-last 1 --keep-within ${RESTIC_DAYS_TO_KEEP}d --keep-within-monthly ${RESTIC_MONTHS_TO_KEEP}m --prune --cacert ${CERTIFICATE_FILE} + restic -v -r ${RESTIC_REPOSITORY}/files forget --keep-last 1 --keep-daily ${RESTIC_DAYS_TO_KEEP} --keep-monthly ${RESTIC_MONTHS_TO_KEEP} --prune --cacert ${CERTIFICATE_FILE} fi } diff --git a/infrastructure/docker/image/resources/pg-functions.sh b/infrastructure/docker/image/resources/pg-functions.sh index 3079a47..20827d3 100644 --- a/infrastructure/docker/image/resources/pg-functions.sh +++ b/infrastructure/docker/image/resources/pg-functions.sh @@ -47,7 +47,7 @@ function roles-unlock-command() { } function roles-forget-command() { - restic -v -r ${RESTIC_REPOSITORY}/pg-role forget --keep-last 1 --keep-within ${RESTIC_DAYS_TO_KEEP}d --keep-within-monthly ${RESTIC_MONTHS_TO_KEEP}m --prune $@ + restic -v -r ${RESTIC_REPOSITORY}/pg-role forget --keep-last 1 --keep-daily ${RESTIC_DAYS_TO_KEEP} --keep-monthly ${RESTIC_MONTHS_TO_KEEP} --prune $@ } function backup-roles() { @@ -72,7 +72,7 @@ function db-unlock-command() { } function db-forget-command() { - restic -v -r ${RESTIC_REPOSITORY}/pg-database forget --keep-last 1 --keep-within ${RESTIC_DAYS_TO_KEEP}d --keep-within-monthly ${RESTIC_MONTHS_TO_KEEP}m --prune $@ + restic -v -r ${RESTIC_REPOSITORY}/pg-database forget --keep-last 1 --keep-daily ${RESTIC_DAYS_TO_KEEP} --keep-monthly ${RESTIC_MONTHS_TO_KEEP} --prune $@ } function backup-db-dump() {