From 9c7586c7c3a235672ec6490d1a8bc44a222ce5d1 Mon Sep 17 00:00:00 2001 From: Colin Wilk Date: Tue, 1 Sep 2026 21:01:05 +0200 Subject: Add borg prune and compact jobs Run repository retention either after a successful backup or from a dedicated systemd timer. Clean up script generation with templates and expand molecule test coverage. BREAKING CHANGE: Aggregate backup scripts are no longer managed, and state=preset now requires at least one readable included directory. --- templates/borg_backup.service.j2 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'templates/borg_backup.service.j2') diff --git a/templates/borg_backup.service.j2 b/templates/borg_backup.service.j2 index 04f2a49..c4901c3 100644 --- a/templates/borg_backup.service.j2 +++ b/templates/borg_backup.service.j2 @@ -1,10 +1,13 @@ [Unit] Description=Runs borgbackup to create application level backup (ANSIBLE MANAGED) Wants={{ borg_backup_timer_name }}{{ "@" if borg_backup_argument != "" }}{{ borg_backup_argument }}.timer +{% if borg_prune_enabled and borg_prune_trigger == 'after_backup' %} +OnSuccess={{ borg_prune_service_name }}{{ "@" if borg_backup_argument != "" }}{{ borg_backup_argument }}.service +{% endif %} [Service] Type=oneshot -ExecStart={{ borg_backup_script_location }} +ExecStart={{ borg_backup_script_location }}{{ "@" if borg_backup_argument != "" else "" }}{{ borg_backup_argument }} User={{ borg_client_user }} Group={{ borg_client_user }} {% if borg_backup_service_successful_exit_status | length > 0 %} -- cgit v1.2.3