#!/bin/bash #判断进程是否存在,如果不存在就启动它 PIDS=`ps aux |grep myprocess |grep -v grep | awk '{print $2}'` if [ "$PIDS" != "" ]; then echo "myprocess is runing!" else cd /root/ ./myprocess #运行进程
#!/bin/bash #判断进程是否存在,如果不存在就启动它 PIDS=`ps aux |grep myprocess |grep -v grep | awk '{print $2}'` if [ "$PIDS" != "" ]; then echo "myprocess is runing!" else cd /root/ ./myprocess #运行进程
本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。