zoukankan      html  css  js  c++  java
  • Spring 启动脚本

    if [ $# != 3 ];then
    echo 'option-1: start,stop or restart.'
    echo 'option-2: 请传入jar路径'
    echo 'option-3: log名称'
    
    exit;
    fi
    
    option=$1
    jarname=$2
    logName=$3
    if [ $option = "start" ];then
        nohup java -Xms512M -Xmx1024M -jar $jarname > /data/service/yun/logs/$logName.log 2>&1 &
    elif [ $option = "stop" ];then
        pids=`ps -ef | grep $jarname | grep -v "grep" | awk '{print $2}'`
        if [ "$pids" = "" ]; then
          echo "no kill !"
        else
          echo "kill with $pids"
        /bin/kill -9 ${pids}
        fi
    
    elif [ $option = "restart" ];then
        pids=`ps -ef | grep $jarname | grep -v "grep" | awk '{print $2}'`
        if [ "$pids" = "" ]; then
          echo "no kill !"
        else
          echo "kill with $pids"
        /bin/kill -9 ${pids}
        fi
        sleep 3
        nohup java -Xms512M -Xmx1024M -jar $jarname > /data/service/yun/logs/$logName.log 2>&1 &
    else
        exit 0
    fi
  • 相关阅读:
    Linux文件及目录查找
    英语单词independent
    英语单词omitting
    英语单词deploy
    英语单词debug
    线程
    进程
    操作系统历史
    分布式爬虫
    爬虫基础
  • 原文地址:https://www.cnblogs.com/yy123/p/10718665.html
Copyright © 2011-2022 走看看