aboutsummaryrefslogtreecommitdiffstats
path: root/templates/borg_backup_script.j2
diff options
context:
space:
mode:
Diffstat (limited to 'templates/borg_backup_script.j2')
-rw-r--r--templates/borg_backup_script.j215
1 files changed, 15 insertions, 0 deletions
diff --git a/templates/borg_backup_script.j2 b/templates/borg_backup_script.j2
new file mode 100644
index 0000000..0ef22ff
--- /dev/null
+++ b/templates/borg_backup_script.j2
@@ -0,0 +1,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(' ') }}