Improve time-since-last-scrub calculation.

This can be needed to compensate anticongestion delays in 410.pkg-audit or 480.leapfile-ntpd.

PR:		217622
Submitted by:	wbe@psr.com
MFC after:	2 weeks
This commit is contained in:
Michael Reifenberger 2017-05-20 16:47:00 +00:00
parent 775e1e023f
commit e817140df0
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=318577

View File

@ -71,7 +71,7 @@ case "$daily_scrub_zfs_enable" in
# Now minus last scrub (both in seconds) converted to days.
_scrub_diff=$(expr -e \( $(date +%s) - \
$(date -j -f %F.%T ${_last_scrub} +%s) \) / 60 / 60 / 24)
$(date -j -v -70M -f %F.%T ${_last_scrub} +%s) \) / 60 / 60 / 24)
if [ ${_scrub_diff} -lt ${_pool_threshold} ]; then
echo " skipping scrubbing of pool '${pool}':"
echo " last scrubbing is ${_scrub_diff} days ago, threshold is set to ${_pool_threshold} days"