diff options
author | gjb <gjb@FreeBSD.org> | 2016-02-08 12:16:01 +0000 |
---|---|---|
committer | gjb <gjb@FreeBSD.org> | 2016-02-08 12:16:01 +0000 |
commit | a44dc347a772a938a3a1e624b4809e7b74f58feb (patch) | |
tree | 06859f2b48e0d90b7e6715c5a5045b4b24de5822 /etc/periodic/daily | |
parent | b0e94739464da6f4e73a5f3e80ec779480d16892 (diff) | |
parent | 2ed1e2991e3970aeffef7be33b91401f0aeca84d (diff) | |
download | FreeBSD-src-a44dc347a772a938a3a1e624b4809e7b74f58feb.zip FreeBSD-src-a44dc347a772a938a3a1e624b4809e7b74f58feb.tar.gz |
MFH
Sponsored by: The FreeBSD Foundation
Diffstat (limited to 'etc/periodic/daily')
-rwxr-xr-x | etc/periodic/daily/800.scrub-zfs | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/etc/periodic/daily/800.scrub-zfs b/etc/periodic/daily/800.scrub-zfs index 359be13..64eac99 100755 --- a/etc/periodic/daily/800.scrub-zfs +++ b/etc/periodic/daily/800.scrub-zfs @@ -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) - \ @@ -73,11 +78,14 @@ case "$daily_scrub_zfs_enable" in continue fi - _status="$(zpool status ${pool} | grep scrub:)" + _status="$(zpool status ${pool} | grep scan:)" case "${_status}" in *"scrub in progress"*) echo " scrubbing of pool '${pool}' already in progress, skipping:" ;; + *"resilver in progress"*) + echo " resilvering of pool '${pool}' is in progress, skipping:" + ;; *"none requested"*) echo " starting first scrub (since reboot) of pool '${pool}':" zpool scrub ${pool} |