启动脚本
#!/bin/bash# jar path
APP_NAME=/apps/xxl-job/xxl-job-admin-2.3.1-SNAPSHOT.jar#log path
LOG_NAME=/apps/logs/xxl-job/xxl-job-admin.log#kill process
pid=`ps -ef|grep $APP_NAME | grep -v grep | awk '{print $2}'`
kill -9 $pidecho "$pid kill success"sleep 2#check jar exist, yes? start and open log file
if test -e $APP_NAME
then
echo "app exist, start"#start jar
nohup java -Xms512m -Xmx512m -Xmn128m -Xss256K -XX:PermSize=256m -jar $APP_NAME >$LOG_NAME 2>&1 &#start success, open log file
tail -f $LOG_NAME#file not exist, prompt!
else
echo "$APP_NAME is not exist, please check it out"
fi