首先要编写一个shell脚本
#!/bin/bash
while true
do
procnum=` ps -ef|grep "程序名"|grep -v grep|wc -l`
if [ $procnum -eq 0 ]; then
完整路径&
fi
sleep 30
done
然后运行shell脚本就可以了
比如
sh .sh&
这边加上一个&是为了让shell脚本在后台运行。
首先要编写一个shell脚本
#!/bin/bash
while true
do
procnum=` ps -ef|grep "程序名"|grep -v grep|wc -l`
if [ $procnum -eq 0 ]; then
完整路径&
fi
sleep 30
done
然后运行shell脚本就可以了
比如
sh .sh&
这边加上一个&是为了让shell脚本在后台运行。