美文网首页
shell script自动拉起进程

shell script自动拉起进程

作者: 树懒吃糖_ | 来源:发表于2019-11-18 15:09 被阅读0次

shell自动拉起进程:

!#/bin/bash
while true  
do  
    procnum=`ps -ef | grep "dujl" | grep -v grep | wc -l`  
    if [ $procnum -eq 0 ]; then  
        nohup /home/work/MakeRun &  
    fi  
    sleep 10
done

ps -ef :所有进程
grep -v grep : 会列出指定用户和root 用户的进行

相关文章

网友评论

      本文标题:shell script自动拉起进程

      本文链接:https://www.haomeiwen.com/subject/npcbictx.html