diff options
author | jpaetzel <jpaetzel@FreeBSD.org> | 2011-01-23 17:13:29 +0000 |
---|---|---|
committer | jpaetzel <jpaetzel@FreeBSD.org> | 2011-01-23 17:13:29 +0000 |
commit | 8a8469590df2c4820f78f91cac10aa0c4fdac153 (patch) | |
tree | b4d4107aa6bf6989447e0012f2c4e5ec24c9342a | |
parent | 4bf47934330868b686707a27bc118b639cc57406 (diff) | |
download | FreeBSD-src-8a8469590df2c4820f78f91cac10aa0c4fdac153.zip FreeBSD-src-8a8469590df2c4820f78f91cac10aa0c4fdac153.tar.gz |
This script parses output of userland tools. In the case of a faulted
zpool the output causes the script to bail out with syntax errors.
Since a scrub of a faulted zpool is pointless, just skip over any pools
marked as such.
PR: conf/150228
Submitted by: jpaetzel
Approved by: kib (mentor)
MFC after: 3 days
MFC note: only for RELENG_8
-rwxr-xr-x | etc/periodic/daily/800.scrub-zfs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/etc/periodic/daily/800.scrub-zfs b/etc/periodic/daily/800.scrub-zfs index f60588abf..01577c1 100755 --- a/etc/periodic/daily/800.scrub-zfs +++ b/etc/periodic/daily/800.scrub-zfs @@ -24,13 +24,17 @@ case "$daily_scrub_zfs_enable" in for pool in ${daily_scrub_zfs_pools}; do # sanity check - zpool list ${pool} >/dev/null 2>&1 + _status=$(zpool list ${pool} | sed -n -e '$p') if [ $? -ne 0 ]; then echo " WARNING: pool '${pool}' specified in" echo " '/etc/periodic.conf:daily_scrub_zfs_pools'" echo " does not exist" continue fi + if echo ${_status} | grep -q FAULTED; then + echo "Skipping faulted pool: ${pool}" + continue + fi # successful only if there is at least one pool to scrub rc=0 |