[root@mail shell]# clear
[root@mail shell]# cat chkamavisd.sh
#!/bin/bash
while true
do
DATA=`date +%Y-%m-%d-%H:%M`
COUNT=`cat /shell/amavisd.log | wc -l`
ps aux | grep amavisd | grep -v grep | grep -v chkamavisd.sh &> /dev/null
if [ $? -ne 0 ];
then
echo "$DATA err" >> /shell/amavisd.log
echo "fu wu err ci shu: $COUNT" > /shell/toji
/etc/init.d/amavisd restart
fi
sleep 10
done本文出自 “服务器平台搭建” 博客,请务必保留此出处http://wangxiaoqiang.blog.51cto.com/7177302/1367476
原文:http://wangxiaoqiang.blog.51cto.com/7177302/1367476