#!/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 #运行进程
相关文章: