Tomcat 启动脚本,对日志进行自动备份.

#!/bin/sh

# baklogs

#2015-02-26

#pufan


BackupPath=/tmp/logsbak/


if [ -d "$BackupPath" ]


then


echo "**********************1:dele baklogs***************************8"


cd /tmp/logsbak


rm -rf *


echo "***********************2:stop tomcat!********************"

ps -ef|grep /tomcat_eomobi_crm|grep -v grep|cut -c 9-15|xargs kill -9



echo "**********************3:copy logs************************8"

mv /root/tomcat_hummermobi_crm/log/* /tmp/logsbak/


echo "***********************4:start tomcat!********************"

/root/tomcat_eomobi_crm/bin/startup.sh


echo "***********************3:baklogs is end!*************************


else


echo "***********************error*******************************8"


fi


转载于:https://my.oschina.net/pufan/blog/380189

你可能感兴趣的:(Tomcat 启动脚本,对日志进行自动备份.)