#!/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刪除。