Merge pull request #13 from DrDth/master

fix monitoring function for newer version of restic
This commit is contained in:
Alexander Rust 2018-01-23 08:24:20 +01:00 committed by GitHub
commit 6f463f450b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -86,7 +86,7 @@ do_monitor () {
CRIT=$5 CRIT=$5
# Get last line and parse into variables. Removes header and is empty when no snapshot exists for host # Get last line and parse into variables. Removes header and is empty when no snapshot exists for host
LAST=`$RESTIC snapshots --compact --no-lock -H $3 | sed 1,2d | tail -n 1` LAST=`$RESTIC snapshots --compact --no-lock -H $3 | sed 1,2d | head -n -2 | tail -n 1`
if [ ! $? -eq 0 ]; then if [ ! $? -eq 0 ]; then
echo "WARNING - restic command returned an error" echo "WARNING - restic command returned an error"
exit 1; exit 1;