服务器定时运行脚本properties

#!/bin/bash


jarDir="/mnt/webapp/gdtads/"
jar="gdtads.jar"

time2=$(date "+%Y%m%d %H:%M:%S" )

cd ${jarDir}
pid=`ps -eaf | grep ${jar} | grep -v grep | awk '{print $2}'`
echo $pid
if [ -z "${pid}" ]; then
   echo "${time2}jar 不存在"
   nohup java -Dspring.config.location=application-online.properties -Xmx1g -Xms1g -Xloggc:gc.log -XX:+UseParallelGC -XX:+UseParallelOldGC -jar ${jar}  > nohup.out 2>&1 &
else
   echo "${time2}jar 存在"
fi
posted @ 2022-07-07 15:04  meeto  阅读(56)  评论(0)    收藏  举报