Index: /main/waeup-ansible/templates/borg-backup.sh.j2
===================================================================
--- /main/waeup-ansible/templates/borg-backup.sh.j2	(revision 15926)
+++ /main/waeup-ansible/templates/borg-backup.sh.j2	(revision 15926)
@@ -0,0 +1,79 @@
+#!/usr/bin/env bash
+
+##
+## This script was generated from template by ansible
+## based on:
+##   https://community.hetzner.com/tutorials/install-and-configure-borgbackup/de
+##   https://github.com/noplanman/ansible-role-borgbackup
+##
+
+##
+## Setzten von Umgebungsvariablen
+##
+
+## falls nicht der Standard SSH Key verwendet wird können
+## Sie hier den Pfad zu Ihrem private Key angeben
+# export BORG_RSH="ssh -i /home/userXY/.ssh/id_ed25519"
+
+## Damit das Passwort vom Repository nicht eingegeben werden muss
+## kann es in der Umgepungsvariable gesetzt werden
+. /root/backup/.borg_passphrase
+
+##
+## Setzten von Variablen
+##
+
+LOG="/var/log/borg/backup.log"
+
+{% for b in borgbackup_servers %}
+
+BACKUP_USER="{{ b.user  }}"
+REPOSITORY_DIR="{{ inventory_hostname_short }}"
+
+## Hinweis: Für die Verwendung mit einem Backup-Account muss
+## 'your-storagebox.de' in 'your-backup.de' geändert werden.
+
+REPOSITORY="ssh://{{ b.user }}@{{ b.fqdn }}:{{ b.port }}/./{{ b.home }}{{ b.pool }}/{{ inventory_hostname_short }}"
+
+##
+## Ausgabe in Logdatei schreiben
+##
+
+exec > >(tee -i -a ${LOG})
+exec 2>&1
+
+echo "###### Backup gestartet: $(date) ######"
+
+##
+## An dieser Stelle können verschiedene Aufgaben vor der
+## Übertragung der Dateien ausgeführt werden, wie z.B.
+##
+## - Liste der installierten Software erstellen
+## - Datenbank Dump erstellen
+##
+
+##
+## Dateien ins Repository übertragen
+## Gesichert werden hier beispielsweise die Ordner root, etc,
+## var/www und home
+## Ausserdem finden Sie hier gleich noch eine Liste Excludes,
+## die in kein Backup sollten und somit per default ausgeschlossen
+## werden.
+##
+
+echo "Übertrage Dateien ..."
+/usr/bin/borg create -v --stats          \
+    $REPOSITORY::'{now:%Y-%m-%d_%H:%M}'  \
+    {% for dir in borgbackup_include %}{{ dir }} {% endfor %} \
+    --exclude /dev                       \
+    --exclude /proc                      \
+    --exclude /sys                       \
+    --exclude /var/run                   \
+    --exclude /run                       \
+    --exclude /lost+found                \
+    --exclude /mnt                       \
+    --exclude /var/lib/lxcfs
+
+echo "###### Backup beendet: $(date) ######"
+
+{% endfor %}
Index: /main/waeup-ansible/templates/borg-init.sh.j2
===================================================================
--- /main/waeup-ansible/templates/borg-init.sh.j2	(revision 15926)
+++ /main/waeup-ansible/templates/borg-init.sh.j2	(revision 15926)
@@ -0,0 +1,17 @@
+#!/bin/bash
+
+#
+# Initialize borg repository
+#
+# This script was generated from a template by ansible.
+#
+
+# Sourcing the backup-passphrase
+. /root/backup/.borg_passphrase
+
+
+{% for b in borgbackup_servers %}
+REPOSITORY=ssh://{{ b.user }}@{{ b.fqdn }}:{{ b.port }}/./{{ b.home }}{{ b.pool }}/{{ inventory_hostname_short }}
+echo "Initializing borg repo $REPOSITORY..."
+/usr/bin/borg init -v --encryption={{ borgbackup_encryption_mode }} --storage-quota={{ b.quota }} --make-parent-dirs {{ b.options }} $REPOSITORY
+{% endfor %}
Index: /main/waeup-ansible/templates/sb-ftp.sh.j2
===================================================================
--- /main/waeup-ansible/templates/sb-ftp.sh.j2	(revision 15926)
+++ /main/waeup-ansible/templates/sb-ftp.sh.j2	(revision 15926)
@@ -0,0 +1,11 @@
+#!/bin/bash
+
+#
+# Make an sftp connection to the storagebox
+#
+# This script was generated from a template by ansible.
+#
+
+{% for b in borgbackup_servers %}
+sftp {{ b.user }}@{{ b.fqdn }}
+{% endfor %}
