From d271c0be9359faef0563c6778112defbac90f2f7 Mon Sep 17 00:00:00 2001 From: Alexander Rust Date: Mon, 18 Sep 2017 10:41:05 +0200 Subject: [PATCH] using new --compact option for snapshot monitoring, returning error when restic command fails --- bin/backup | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/backup b/bin/backup index c540ad4..94787a0 100755 --- a/bin/backup +++ b/bin/backup @@ -86,8 +86,9 @@ do_monitor () { CRIT=$5 # Get last line and parse into variables. Removes header and is empty when no snapshot exists for host - LAST=`$RESTIC snapshots --no-lock -H $3 | sed 1,2d | tail -n 1` + LAST=`$RESTIC snapshots --compact --no-lock -H $3 | sed 1,2d | tail -n 1` if [ ! $? -eq 0 ]; then + echo "WARNING - restic command returned an error" exit 1; fi