From 466eaeefb022a65d307e7c662e3cf869137ea1cb Mon Sep 17 00:00:00 2001 From: Paul Lecuq Date: Thu, 1 Oct 2020 23:07:04 +0200 Subject: [PATCH] updated borg script template --- states/borg/templates/borg_job.sh.j2 | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/states/borg/templates/borg_job.sh.j2 b/states/borg/templates/borg_job.sh.j2 index 39b5323..ea3e0a9 100755 --- a/states/borg/templates/borg_job.sh.j2 +++ b/states/borg/templates/borg_job.sh.j2 @@ -28,11 +28,16 @@ borg create \ --stats \ --show-rc \ --compression {{ job.compression|default('lz4') }} \ +{%- if job.excluded_dirs is defined -%} +{%- for exclude in job.excluded_dirs %} + --exclude '{{ exclude }}' \ +{%- endfor %} +{%- endif %} --exclude-caches \ - ::$backup_name'-{hostname}-{now}' \ -{% for include in job.included_dirs -%} + ::$backup_name'-{hostname}-{now}' \ +{%- for include in job.included_dirs %} {{ include }} \ -{% endfor -%} +{%- endfor %} 2>> {{ working_dir }}/logs/${backup_name}-$(date +%Y-%m-%d).log backup_exit=$?