#!/bin/sh # run once a nice through cron # smartctl differences for i in 0 1 2 3 4 5 6 7; do # we strip the numbers from the error log to reduce diff noise when # the log grows. /usr/sbin/smartctl -a -d 3ware,$i /dev/twa0 \ | perl -pe 's/^Num Test/Test/; s/^#[ \d]{2} (.*\d%\s+\d+)/$1/' > twa0.$i.new diff -u0 \ -I '^Local Time is:' \ -I '^ 9 Power_On_Minutes' \ -I '^ 9 Power_On_Hours' \ -I '^ 8 Seek_Time_Performance' \ -I '^195 Hardware_ECC_Recovered' \ -I '^201 Soft_Read_Error_Rate' \ twa0.$i.old twa0.$i.new mv twa0.$i.new twa0.$i.old done