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) - \
_______________________________________________
svn-src-stable-10@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-stable-10
To unsubscribe, send any mail to "svn-src-stable-10-unsubscr...@freebsd.org"

Reply via email to