summaryrefslogtreecommitdiffstats
path: root/etc/periodic
diff options
context:
space:
mode:
authormav <mav@FreeBSD.org>2016-02-05 17:28:11 +0000
committermav <mav@FreeBSD.org>2016-02-05 17:28:11 +0000
commitc212e48d5be4c79d408a59189b0eddbaed1585bc (patch)
tree45ab6ba75be12c8d73296c905ce37ddf91d19430 /etc/periodic
parent9accef3f0f76cde9f02a5d55f391aa02355ddc2b (diff)
downloadFreeBSD-src-c212e48d5be4c79d408a59189b0eddbaed1585bc.zip
FreeBSD-src-c212e48d5be4c79d408a59189b0eddbaed1585bc.tar.gz
Add error check to not leak logs with syntax errors in case of failed
`zpool history`. MFC after: 1 month
Diffstat (limited to 'etc/periodic')
-rwxr-xr-xetc/periodic/daily/800.scrub-zfs5
1 files changed, 5 insertions, 0 deletions
diff --git a/etc/periodic/daily/800.scrub-zfs b/etc/periodic/daily/800.scrub-zfs
index 359be13..b7a009d 100755
--- a/etc/periodic/daily/800.scrub-zfs
+++ b/etc/periodic/daily/800.scrub-zfs
@@ -63,6 +63,11 @@ case "$daily_scrub_zfs_enable" in
_last_scrub=$(zpool history ${pool} | \
sed -ne '2s/ .*$//p')
fi
+ if [ -z "${_last_scrub}" ]; then
+ echo " skipping scrubbing of pool '${pool}':"
+ echo " can't get last scrubbing date"
+ continue
+ fi
# Now minus last scrub (both in seconds) converted to days.
_scrub_diff=$(expr -e \( $(date +%s) - \
OpenPOWER on IntegriCloud