diff options
Diffstat (limited to 'ansible/roles/borg-client/templates/bin')
-rw-r--r-- | ansible/roles/borg-client/templates/bin/create-backup | 2 | ||||
-rw-r--r-- | ansible/roles/borg-client/templates/bin/create-backup-send-email | 17 |
2 files changed, 18 insertions, 1 deletions
diff --git a/ansible/roles/borg-client/templates/bin/create-backup b/ansible/roles/borg-client/templates/bin/create-backup index dfbe72d..cf75edf 100644 --- a/ansible/roles/borg-client/templates/bin/create-backup +++ b/ansible/roles/borg-client/templates/bin/create-backup @@ -11,7 +11,7 @@ export BORG_RSH cmd=() cmd+=(borg create) cmd+=(--stats) -cmd+=(--progress) +#cmd+=(--progress) cmd+=(--json) cmd+=(--exclude-from=/etc/borg/excludes) cmd+=(--patterns-from=/etc/borg/patterns) diff --git a/ansible/roles/borg-client/templates/bin/create-backup-send-email b/ansible/roles/borg-client/templates/bin/create-backup-send-email new file mode 100644 index 0000000..65286b1 --- /dev/null +++ b/ansible/roles/borg-client/templates/bin/create-backup-send-email @@ -0,0 +1,17 @@ +#!/bin/bash + +set -euo pipefail + +cd / + + +/usr/sbin/sendmail -t <<ERRMAIL +To: $1 +From: systemd <root@$HOSTNAME> +Subject: Backup @ $HOSTNAME +Content-Transfer-Encoding: 8bit +Content-Type: text/plain; charset=UTF-8 + +$(systemctl status --full 2>&1) +$(journalctl --since today --unit create-backup 2>&1) +ERRMAIL |