Linux shell 清理tomcat缓存及日志

Nov 26, 2016 阅读(768)

标签: Shell Tomcat

     

#!/bin/bash
#---------------------------------------------------------
# 清除tomcat服务器缓存及日志(work、logs、temp)
# 
# Filename: clear-tomcat-cache.sh
# Author: zll
# Time: 2016/11/26
#--------------------------------------------------------

#tomcat主目录所在位置
tomcat_home="/home/webadmin/tomcat1";

echo "开始清理tomcat服务器缓存及目录";

rm -rf $tomcat_home/logs/*;
echo "$tomcat_home/logs/* 清理成功";

rm -rf $tomcat_home/temp/*;
echo "$tomcat_home/temp/* 清理成功";

rm -rf $tomcat_home/work/*;
echo "$tomcat_home/work/* 清理成功";

echo "结束"



MongoDB学习园