From f6db815eff83c30627b32ab08c66d9fa9953aac1 Mon Sep 17 00:00:00 2001 From: Sam Al-Sapti Date: Sat, 11 Nov 2023 14:57:30 +0100 Subject: [PATCH] Restic: Only set PRE- and POST_COMMANDS when Nextcloud is included --- roles/apps/templates/compose-files/restic.yml.j2 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/roles/apps/templates/compose-files/restic.yml.j2 b/roles/apps/templates/compose-files/restic.yml.j2 index 44c492c..de7bfb8 100644 --- a/roles/apps/templates/compose-files/restic.yml.j2 +++ b/roles/apps/templates/compose-files/restic.yml.j2 @@ -20,10 +20,12 @@ services: --keep-daily 7 --keep-weekly 5 --keep-monthly 12 +{% if 'nextcloud' in apps_backup %} PRE_COMMANDS: |- docker compose -f {{ apps_data_root }}/nextcloud/docker-compose.yml exec -u www-data app php occ maintenance:mode --on POST_COMMANDS_EXIT: |- docker compose -f {{ apps_data_root }}/nextcloud/docker-compose.yml exec -u www-data app php occ maintenance:mode --off +{% endif %} B2_ACCOUNT_ID: {{ restic.b2.id }} B2_ACCOUNT_KEY: {{ restic.b2.key }} TZ: {{ timezone }}