aboutsummaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorJulien Dessaux2021-02-22 21:55:29 +0100
committerJulien Dessaux2021-02-22 22:12:53 +0100
commitcab3d045c1e4405182284ff95015c7144563bf38 (patch)
treeb46ade642c5bcc1a96dfca91f9bf92153d652790 /templates
parentAdded action plugins to simplify borg role (diff)
downloadborg-ansible-role-cab3d045c1e4405182284ff95015c7144563bf38.tar.gz
borg-ansible-role-cab3d045c1e4405182284ff95015c7144563bf38.tar.bz2
borg-ansible-role-cab3d045c1e4405182284ff95015c7144563bf38.zip
Simplified and fixed borg role
Diffstat (limited to 'templates')
-rw-r--r--templates/backup.sh.j24
1 files changed, 2 insertions, 2 deletions
diff --git a/templates/backup.sh.j2 b/templates/backup.sh.j2
index 9ac8f1d..b1abb79 100644
--- a/templates/backup.sh.j2
+++ b/templates/backup.sh.j2
@@ -13,9 +13,9 @@ export BORG_RSH="ssh -i /root/.ssh/borg"
{{ job.pre_command }}
{% endif %}
{% if job.command_to_pipe is defined %}
-{{ job.command_to_pipe }} | borg create borg@{{ borg_server }}:/srv/borg/repos/{{ ansible_hostname }}::{{ job.name }}-{now} {{ job.path | default('-') }}
+{{ job.command_to_pipe }} | borg create borg@{{ borg_server }}:/srv/borg/repos/{{ ansible_hostname }}::{{ job.name }}-{now} -
{% else %}
-borg create borg@{{ borg_server }}:/srv/borg/repos/{{ ansible_hostname }}::{{ job.name }}-{now} {{ job.path }}
+borg create {% for exclude in job.exclude|default([]) %} --exclude {{ exclude }}{% endfor %} borg@{{ borg_server }}:/srv/borg/repos/{{ ansible_hostname }}::{{ job.name }}-{now} {{ job.path }}
{% endif %}
{% if job.post_command is defined %}
{{ job.post_command }}