标签:
#!/bin/bash
#auther:acf
#function:monitoring service of httpd
[root@my-cmp Desktop]#cat b.sh
a=`ps -A|grep httpd |grep -v grep|awk ‘{print $4}‘|wc -l`
if [ $a != 0 ];then
echo "httpd is running..."
else echo "httpd was stoped,now httpd is starting..."
/etc/init.d/httpd start
fi
===
===接下来将其写入计划任务中
[root@my-cmp Desktop]# crontab -e
*/10 * * * * /bin/bash /root/Desktop/b.sh
标签:
原文地址:http://www.cnblogs.com/blog-acf/p/4265662.html