diff --git a/setup.sh b/setup.sh index bd46738..9674d76 100644 --- a/setup.sh +++ b/setup.sh @@ -669,8 +669,8 @@ echo " for volume in \${zfsVolumes}" >> /mnt/zfshealth.sh echo " do" >> /mnt/zfshealth.sh echo " if [ \$(/sbin/zpool status \$volume | egrep -c \"none requested\") -ge 1 ]; then echo \"ERROR: You need to run \\\"zpool scrub \$volume\\\" before this script can monitor the scrub expiration time.\"; break; fi" >> /mnt/zfshealth.sh echo " if [ \$(/sbin/zpool status \$volume | egrep -c \"scrub in progress|resilver\") -ge 1 ]; then break; fi" >> /mnt/zfshealth.sh -echo " scrubRawDate=\$(/sbin/zpool status \$volume | grep scrub | awk '{print \$15 \$12 \$13}')" >> /mnt/zfshealth.sh -echo " scrubDate=\$(date -j -f '%Y%b%e-%H%M%S' \$scrubRawDate'-000000' +%s)" >> /mnt/zfshealth.sh +echo " scrubRawDate=\$(/sbin/zpool status \$volume | grep scrub | awk '{print \$15 \$12 \$13}' | sed 's/\([0-9]\+\)\([A-Za-z]*\)\([0-9]\+\)/\\2 \\3, \\1/g')" >> /mnt/zfshealth.sh +echo " scrubDate=\$(date -d \"\$scrubRawDate\" +%s)" >> /mnt/zfshealth.sh echo " if [ \$((\$currentDate - \$scrubDate)) -ge \$scrubExpire ]; then" >> /mnt/zfshealth.sh echo " if [ \${problems} -eq 0 ]; then emailSubject=\"\$emailSubject - Scrub Time Expired. Scrub Needed on Volume(s)\"; fi" >> /mnt/zfshealth.sh echo " problems=1" >> /mnt/zfshealth.sh