Date: Mon, 7 Mar 2016 08:57:51 +0000 (UTC) From: Alexander Motin <mav@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r296440 - stable/10/etc/periodic/daily Message-ID: <201603070857.u278vpea045047@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mav Date: Mon Mar 7 08:57:51 2016 New Revision: 296440 URL: https://svnweb.freebsd.org/changeset/base/296440 Log: MFC r295324: Add error check to not leak logs with syntax errors in case of failed `zpool history`. Modified: stable/10/etc/periodic/daily/800.scrub-zfs Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/periodic/daily/800.scrub-zfs ============================================================================== --- stable/10/etc/periodic/daily/800.scrub-zfs Mon Mar 7 07:57:57 2016 (r296439) +++ stable/10/etc/periodic/daily/800.scrub-zfs Mon Mar 7 08:57:51 2016 (r296440) @@ -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?201603070857.u278vpea045047>