From c6b768e1bb587b7d2364f7251e4c814f0bb083b8 Mon Sep 17 00:00:00 2001 From: Jeltz Date: Mon, 10 May 2021 13:02:45 +0200 Subject: [PATCH 1/3] Don't run borgmatic every hour if not needed --- roles/borgbackup_client/templates/borgmatic.timer.j2 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/roles/borgbackup_client/templates/borgmatic.timer.j2 b/roles/borgbackup_client/templates/borgmatic.timer.j2 index e0e3927..4e575bc 100644 --- a/roles/borgbackup_client/templates/borgmatic.timer.j2 +++ b/roles/borgbackup_client/templates/borgmatic.timer.j2 @@ -4,7 +4,11 @@ Description=Timer for borgmatic backup [Timer] +{% if borg_keep_hourly > 0 %} OnCalendar=hourly +{% else %} +OnCalendar=daily +{% endif %} RandomizedDelaySec=60m FixedRandomDelay=true -- 2.45.2 From c8a877282fd76ec1faf7bf6438c363fa31686a03 Mon Sep 17 00:00:00 2001 From: Jeltz Date: Wed, 19 May 2021 15:29:40 +0200 Subject: [PATCH 2/3] Add 9 & 10 for Debian distribution --- roles/borgbackup_client/tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/borgbackup_client/tasks/main.yml b/roles/borgbackup_client/tasks/main.yml index 728d253..f46e2c1 100644 --- a/roles/borgbackup_client/tasks/main.yml +++ b/roles/borgbackup_client/tasks/main.yml @@ -13,7 +13,7 @@ dest: /etc/apt/preferences.d/borgmatic-bullseye when: - "ansible_distribution == 'Debian'" - - "ansible_distribution_major_version in ('stretch', 'buster')" + - "ansible_distribution_major_version in ('stretch', 'buster', '9', '10')" - name: Install borgmatic apt: -- 2.45.2 From bb97bca456bcb473f01e0c5423d1b220ea2cb22d Mon Sep 17 00:00:00 2001 From: Jeltz Date: Sun, 23 May 2021 14:09:01 +0200 Subject: [PATCH 3/3] Increase RandomizedDelaySec when hourly = 0 --- roles/borgbackup_client/templates/borgmatic.timer.j2 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/roles/borgbackup_client/templates/borgmatic.timer.j2 b/roles/borgbackup_client/templates/borgmatic.timer.j2 index 4e575bc..3511ffd 100644 --- a/roles/borgbackup_client/templates/borgmatic.timer.j2 +++ b/roles/borgbackup_client/templates/borgmatic.timer.j2 @@ -6,10 +6,11 @@ Description=Timer for borgmatic backup [Timer] {% if borg_keep_hourly > 0 %} OnCalendar=hourly +RandomizedDelaySec=60m {% else %} OnCalendar=daily +RandomizedDelaySec=24h {% endif %} -RandomizedDelaySec=60m FixedRandomDelay=true [Install] -- 2.45.2