aboutsummaryrefslogtreecommitdiffstats
path: root/templates/borg_backup_script.j2
blob: 0ef22fff456e7b2087588c09e7a22a7a3ac7270c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/bin/bash
export BORG_PASSPHRASE={{ borg_passphrase | quote }}
{% if borg_ssh_key_per_repo %}
export BORG_RSH="ssh -i {{ borg_ssh_key_path }}"
{% endif %}
borg create \
  -C {{ borg_compression }} \
{% for excluded_dir in borg_excluded_dirs %}
  --exclude {{ excluded_dir | quote }} \
{% endfor %}
{% if borg_create_additional_arguments %}
  {{ borg_create_additional_arguments }} \
{% endif %}
  {{ borg_server_user }}@{{ borg_server_host_url }}:{{ borg_server_user_home }}/{{ borg_repo_name }}::{{ borg_backup_name_format }} \
  {{ borg_included_dirs | map('quote') | join(' ') }}