使用ps做进程查询
#!/bin/sh
while true
do
procnum=`ps -ef|grep "testApp"|grep -v grep|wc -l`
if [ $procnum -eq 0 ]; then
/root/testApp &
fi
sleep 5
done
心若没栖息的地方,到哪都是流浪
#!/bin/sh
while true
do
procnum=`ps -ef|grep "testApp"|grep -v grep|wc -l`
if [ $procnum -eq 0 ]; then
/root/testApp &
fi
sleep 5
done
Tags:
发表回复