Date: Fri, 5 Feb 2016 17:28:11 +0000 (UTC) From: Alexander Motin <mav@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295324 - head/etc/periodic/daily Message-ID: <201602051728.u15HSBvm092020@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mav Date: Fri Feb 5 17:28:11 2016 New Revision: 295324 URL: https://svnweb.freebsd.org/changeset/base/295324 Log: Add error check to not leak logs with syntax errors in case of failed `zpool history`. MFC after: 1 month Modified: head/etc/periodic/daily/800.scrub-zfs Modified: head/etc/periodic/daily/800.scrub-zfs ============================================================================== --- head/etc/periodic/daily/800.scrub-zfs Fri Feb 5 17:14:37 2016 (r295323) +++ head/etc/periodic/daily/800.scrub-zfs Fri Feb 5 17:28:11 2016 (r295324) @@ -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) - \
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201602051728.u15HSBvm092020>