java war run

时间:2022-03-13 16:23:37

#!/bin/bash
date=`date +'%Y%m%d %T'`
pid=`ps -ef |grep Credit | grep -v grep|awk '{print $2}'`
damocles_home=/usr/local/damocles-webapp/
logdir=/home/wwwad
chown wwwad:yizhen /usr/local/damocles-webapp/
chown wwwad. /usr/local/damocles-webapp/conf/*
[ -n "$pid" ] && kill -9 $pid
cd $damocles_home
nohup java -Xms4096m -Xmx4096m -XX:PermSize=512M -XX:MaxPermSize=1024m -Djava.awt.headless=true -XX:SurvivorRatio=4 -XX:ParallelGCThreads=4 -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:CMSInitiatingOccupancyFraction=68 -Dcom.sun.management.jmxremote.port=1099 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Djmagick.systemclassloader=no -Djava.rmi.server.hostname=10.23.24.104 -classpath ".:classes:conf:lib/*" com.yizhenmoney.damocles.common.app.CreditApplication >> $logdir/damocles.out &
[ "$?" -eq 0 ] && echo "$date credit restart successful!" >> $logdir/restart.log
[ "$?" -eq 1 ] && echo "$date credit restart failed,please check and run again!" >>$logdir/restart.log
ps -ef |grep Credit
tail $logdir/restart.log -n 1
sleep 5
tail -f $logdir/damocles.out -n 100