From e35842675fe45872f983d01cc651fdd4f7628f48 Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Sun, 25 Aug 2024 22:18:20 -0400 Subject: [PATCH] Add new is-primary condition to autobackup timers Avoids running these except on the primary coordinator at the time of firing, to avoid duplicate runs being passed to pvcworkerd. --- roles/pvc/templates/autobackup/pvc-autobackup-full.service.j2 | 1 + roles/pvc/templates/autobackup/pvc-autobackup-normal.service.j2 | 1 + 2 files changed, 2 insertions(+) diff --git a/roles/pvc/templates/autobackup/pvc-autobackup-full.service.j2 b/roles/pvc/templates/autobackup/pvc-autobackup-full.service.j2 index 6b6eba5..e71f325 100644 --- a/roles/pvc/templates/autobackup/pvc-autobackup-full.service.j2 +++ b/roles/pvc/templates/autobackup/pvc-autobackup-full.service.j2 @@ -5,4 +5,5 @@ Description=[Cron] PVC VM autobackup (forced-full) Type=oneshot IgnoreSIGPIPE=false KillMode=process +ExecCondition=/usr/bin/pvc --quiet node is-primary ExecStart=/usr/bin/pvc --quiet vm autobackup --cron --force-full {% if pvc_autobackup.reporting.enabled and pvc_autobackup.reporting.report_on.forced_full %}--email-report {{ pvc_autobackup.reporting.emails|join(',') }}{% endif %} diff --git a/roles/pvc/templates/autobackup/pvc-autobackup-normal.service.j2 b/roles/pvc/templates/autobackup/pvc-autobackup-normal.service.j2 index 129a7fe..5ecb2ec 100644 --- a/roles/pvc/templates/autobackup/pvc-autobackup-normal.service.j2 +++ b/roles/pvc/templates/autobackup/pvc-autobackup-normal.service.j2 @@ -5,4 +5,5 @@ Description=[Cron] PVC VM autobackup (normal) Type=oneshot IgnoreSIGPIPE=false KillMode=process +ExecCondition=/usr/bin/pvc --quiet node is-primary ExecStart=/usr/bin/pvc --quiet vm autobackup --cron {% if pvc_autobackup.reporting.enabled and pvc_autobackup.reporting.report_on.normal %}--email-report {{ pvc_autobackup.reporting.emails|join(',') }}{% endif %}