#! /bin/bash
# author qzlink
# time 2014-9-19
# program : check program running ..
function check(){
count=`ps -ef |grep $1 |grep -v "grep"|wc -l`
#echo $count
if [ 0 == $count ];then
#nohup python /runscript/working/$1 &
/etc/init.d/mbx2009d start
fi
}
check mbx2009
# author qzlink
# time 2014-9-19
# program : check program running ..
function check(){
count=`ps -ef |grep $1 |grep -v "grep"|wc -l`
#echo $count
if [ 0 == $count ];then
#nohup python /runscript/working/$1 &
/etc/init.d/mbx2009d start
fi
}
check mbx2009
本文介绍了一个简单的bash脚本,用于检查指定进程是否正在运行。如果未运行,则通过启动指定的服务来确保进程始终处于活动状态。此脚本适用于系统监控和维护任务。
4137

被折叠的 条评论
为什么被折叠?



