From 8d743b9073fd98d3d5e4e6e6e0c18b21a539bf15 Mon Sep 17 00:00:00 2001
From: Florian Pritz <bluewind@xinu.at>
Date: Sun, 18 Sep 2016 18:21:07 +0200
Subject: [PATCH] borg-client: Use set -e in backup script

Signed-off-by: Florian Pritz <bluewind@xinu.at>
---
 roles/borg-client/templates/borg-backup.sh.j2 | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/roles/borg-client/templates/borg-backup.sh.j2 b/roles/borg-client/templates/borg-backup.sh.j2
index 2ff08cc60..b90fa3e9a 100644
--- a/roles/borg-client/templates/borg-backup.sh.j2
+++ b/roles/borg-client/templates/borg-backup.sh.j2
@@ -1,7 +1,9 @@
 #!/usr/bin/env bash
 
+set -e
+
 # In case there is postgresql running, dump all of it somewhere.
-systemctl status postgresql && /usr/local/bin/backup-postgres.sh
+systemctl status postgresql && /usr/local/bin/backup-postgres.sh || true
 
 borg create -v --stats -C lz4 -e /proc \
     -e /sys -e /dev -e /run -e /tmp -e /var/cache \
-- 
GitLab