监听mysql是否挂了,如果挂了就重启mysql
#!/bin/bashpgrep -x mysqld &> /dev/nullif [ $? -ne 0 ]thenecho "At time: `date` :MySQL is stop .">> /var/log/mysql_messagesservice mysql start#echo "At time: `date` :MySQL server is stop."elseecho "MySQL server is running ."fi原文:http://www.cnblogs.com/ytfcz/p/4964940.html