您的位置:首页 > 运维架构 > Shell

用shell脚本判断进程是否存在,并重新启动

2012-10-11 11:25 627 查看
#! /bin/bash
#  author caoxin
#  time  2012-10-10
#  program : 判断进行是否存在,并重新启动

function check(){
count=`ps -ef |grep $1 |grep -v "grep" |wc -l`
#echo $count
if [ 0 == $count ];then
nohup  python  /runscript/working/$1 &
fi
}

check behaviors.py

参考的网址为:  http://blog.csdn.net/shangpusp/article/details/7210446
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: