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 用户的进行
网友评论