HDD spindown check

Nachdem ich meine Platten jetzt schlafenlegen kann, würde ich auch gerne wissen wann und ob dies erfolgt…

# Usage
 
Output state:
./check_hdd_spindown.sh /dev/sda /dev/sdb /dev/sdc
 
Log state into file:
./check_hdd_spindown.sh /dev/sda /dev/sdb /dev/sdc >> /var/log/spindown.log &
#!/bin/sh
 
while [ 1 ]
do
        i=0
        for DRIVE in $*
        do
                DATE=`date +"%Y-%m-%d %H:%M:%S"`
                RESULT_OLD=${RESULT[i]}
                RESULT[$i]=`hdparm -C $DRIVE | grep state`
 
                if [ "$RESULT_OLD" != "${RESULT[i]}" ]
                        then echo $DATE $DRIVE ${RESULT[i]}
                fi
 
                i=$i+1
        done
 
        sleep 5
done
This entry was posted in Linux, Storage, Tools and tagged , . Bookmark the permalink.

Hinterlasse eine Antwort

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind markiert *

*

Du kannst folgende HTML-Tags benutzen: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">