aboutsummaryrefslogtreecommitdiff
path: root/templates/backup.sh.j2
blob: a029080ad8bfb0784ce547d3e7bcae607c34a06f (plain)
1
2
3
4
5
6
7
8
9
10
11
#!/bin/sh

{% for job in borg_jobs %}
{% if job.command_to_pipe is defined %}
{{ job.command_to_pipe }} | BORG_RSH="ssh -i /root/.ssh/borg" borg create borg@{{ borg_server }}:/srv/borg/repos/{{ ansible_hostname }}::{{ job.name }}-{now} {{ job.path | default('-') }}
{% else %}
BORG_RSH="ssh -i /root/.ssh/borg" borg create borg@{{ borg_server }}:/srv/borg/repos/{{ ansible_hostname }}::{{ job.name }}-{now} {{ job.path }}
{% endif %}
{% endfor %}

BORG_RSH="ssh -i /root/.ssh/borg" borg prune borg@{{ borg_server }}:/srv/borg/repos/{{ ansible_hostname }} {{ borg_prune_arguments }}