From 405ce725387a334df782931f8f4dbab34ac4b881 Mon Sep 17 00:00:00 2001 From: James Bunton Date: Sun, 19 Jul 2020 23:30:15 +1000 Subject: [PATCH] lib-ext-backup: exit 1 on scrub failure --- hacks/lib-ext-backup | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hacks/lib-ext-backup b/hacks/lib-ext-backup index f90faba..4e72792 100644 --- a/hacks/lib-ext-backup +++ b/hacks/lib-ext-backup @@ -79,6 +79,11 @@ function pool_maybe_scrub { sleep 60 done echo " done" + + if zpool list -H -o health "$ZPOOLNAME" | grep -qv ONLINE; then + zpool status -v "$ZPOOLNAME" + return 1 + fi } function syncoidw { -- 2.39.2