mirror of
https://github.com/opnsense/src.git
synced 2026-06-14 19:20:18 -04:00
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
c80429cedb
commit
b0fcd5fba2
1 changed files with 5 additions and 0 deletions
|
|
@ -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…
Reference in a new issue