Add error check to not leak logs with syntax errors in case of failed
`zpool history`. MFC after: 1 month
This commit is contained in:
parent
9accef3f0f
commit
c212e48d5b
@ -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) - \
|
||||
|
Loading…
x
Reference in New Issue
Block a user