Date: Sun, 23 Jan 2011 17:13:29 +0000 (UTC) From: Josh Paetzel <jpaetzel@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r217755 - head/etc/periodic/daily Message-ID: <201101231713.p0NHDTvg062076@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: jpaetzel Date: Sun Jan 23 17:13:29 2011 New Revision: 217755 URL: http://svn.freebsd.org/changeset/base/217755 Log: 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 Modified: head/etc/periodic/daily/800.scrub-zfs Modified: head/etc/periodic/daily/800.scrub-zfs ============================================================================== --- head/etc/periodic/daily/800.scrub-zfs Sun Jan 23 16:28:44 2011 (r217754) +++ head/etc/periodic/daily/800.scrub-zfs Sun Jan 23 17:13:29 2011 (r217755) @@ -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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201101231713.p0NHDTvg062076>