做DD遷移時候的監控指令碼,很有用的喲。

sonsunny發表於2008-08-20

linux 環境下
#!/bin/bash
while true
do
DDRUN=$(ps -ef | grep dd | grep -v grep | wc -l)

[@more@]if [ $DDRUN = 0 ] ; then

echo "--------------------------DD IS FINISHED OR NO DD---------------"

exit

else


echo "------------------------DD IS RUNING-----------------------------"
ps -ef | grep dd |grep if | grep -v grep | awk '{print $8,$9,"=",$10,$11,"=",$12,$13,$14}'
date

fi
sleep 10
done


HP unix環境下

#!/sbin/sh
while true
do
DDRUN=$(ps -ef | grep dd | grep -v grep | wc -l)
if [ $DDRUN = 0 ] ; then

echo "--------------------------DD Finished Or No DD Proccess---------------"

exit

else


echo "------------------------DD IS RUNING-----------------------------"
ps -ef | grep dd |grep if | grep -v grep | awk '{print $8,$9,$10,$11}'
date

fi
sleep 10
done

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/15192459/viewspace-1009197/,如需轉載,請註明出處,否則將追究法律責任。

相關文章