#!/bin/bash
echo 'begin copy...'
cd `dirname $0`
BIN_DIR=`pwd`
cd ..
DEPLOY_DIR=`pwd`
LOGS_DIR=$DEPLOY_DIR/logs
if [ ! -d $LOGS_DIR ]; then
mkdir $LOGS_DIR
fi
APP_CONF_DIR=$DEPLOY_DIR/myconf
if [ -d $APP_CONF_DIR ] && [ -d $DEPLOY_DIR/webapps/ROOT/WEB-INF/classes ]; then
echo '加载APP自定义配置项'
\cp -rf $APP_CONF_DIR/* $DEPLOY_DIR/webapps/ROOT/WEB-INF/classes
fi
killTomcat()
{
PID=$(ps -ef | grep $BIN_DIR | grep -v grep | awk '{print $2}')
echo "That tomcat pid list is:${PID}"
for id in $PID
do
echo "kill pid: $id"
kill -9 $id
done
}
echo 'begin delete work...'
#删除tomcat工作目录下所有缓存数据
rm -rf ${DEPLOY_DIR}/work/
echo -e "starting restart ...\c"
cd $BIN_DIR
killTomcat
sleep 10s
./catalina.sh start
echo "exit!"
exit 0;
tomcat restart脚本
最新推荐文章于 2023-12-28 16:53:44 发布