jar包(snc-businessdata.jar)部署在: /home/domp-product/snc-bizdata/目录,构建工程的时候自动启停脚本如下:

cd  /home/domp-product/snc-bizdata/

pid=`ps -ef| grep snc-businessdata.jar| grep -v "grep"| awk '{print $2}'`
 
if [ -n "${pid}" ];then
    echo "Will shutdown snc-businessdata: ${pid}"
    kill -9 ${pid}
    sleep 2
   java -jar snc-businessdata.jar  & 

    new_pid=`ps -ef| grep snc-businessdata.jar| grep -v "grep"| awk '{print $2}'`
 
    if [ -n "${new_pid}" ];then
        echo "snc-businessdata has been started.The new pid is ${new_pid}!"
        sleep 2
     else
        echo "snc-businessdata did not start!" 
    fi
else
    echo "No snc-businessdata process! Start in 3 seconds"
    sleep 3    
    java -jar snc-businessdata.jar  & 
 fi

 

Logo

权威|前沿|技术|干货|国内首个API全生命周期开发者社区

更多推荐