aboutsummaryrefslogtreecommitdiff
path: root/templates/backup.sh.j2
diff options
context:
space:
mode:
authorJulien Dessaux2022-07-05 21:15:26 +0200
committerJulien Dessaux2022-07-05 21:54:40 +0200
commitf084bd976cf942a43df7bbc77c63e21bf1045970 (patch)
tree097b2d2a82b60489c2d22c32e4e7802342d1e82e /templates/backup.sh.j2
parentAllow hyphens in borg job name (diff)
downloadborg-ansible-role-f084bd976cf942a43df7bbc77c63e21bf1045970.tar.gz
borg-ansible-role-f084bd976cf942a43df7bbc77c63e21bf1045970.tar.bz2
borg-ansible-role-f084bd976cf942a43df7bbc77c63e21bf1045970.zip
Fixed authorized_keys configuration drift, and change repo directory from hostname to fqdn
Diffstat (limited to 'templates/backup.sh.j2')
-rw-r--r--templates/backup.sh.j26
1 files changed, 3 insertions, 3 deletions
diff --git a/templates/backup.sh.j2 b/templates/backup.sh.j2
index 3937dfc..57d1854 100644
--- a/templates/backup.sh.j2
+++ b/templates/backup.sh.j2
@@ -15,13 +15,13 @@ 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.command_to_pipe }} | borg create borg@{{ borg_server }}:/srv/borg/repos/{{ inventory_hostname }}::{{ job.name }}-{now} -
{% else %}
-borg create {% for exclude in job.exclude|default([]) %} --exclude {{ exclude }}{% endfor %} 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/{{ inventory_hostname }}::{{ job.name }}-{now} {{ job.path }}
{% endif %}
{% if job.post_command is defined %}
{{ job.post_command }}
{% endif %}
{% endfor %}
-borg prune borg@{{ borg_server }}:/srv/borg/repos/{{ ansible_hostname }} {{ borg_prune_arguments }}
+borg prune borg@{{ borg_server }}:/srv/borg/repos/{{ inventory_hostname }} {{ borg_prune_arguments }}