新建一个.sh文件,保证他是uinx格式文件。然后保存下面内容,修改seal为你的进程名称。修改./seal为你的程序运行位置。


#!/bin/bash

 

while true

do 

    procnum=` ps -ef|grep "seal"|grep -v grep|wc -l`

   if [ $procnum -eq 0 ]; then

       ./seal&

   fi

   sleep 30

  done

linux 如否监视进程报错退出自动运行方法

发表评论 已发布 0

还可以输入 800 个字
看不清?点击更换
 
 
评论 打印