logs脚本

#!/bin/bash
log_path=/usr/local/apache-tomcat-6.0.43/logs
d=`date +%Y-%m-%d`
d2=`date -d'2 day ago' +%Y-%m-%d`
cd ${log_path} && cp catalina.out /usr/local/logs/catalina.out.$d.log
echo > catalina.out
rm -rf /usr/local/logs/catalina.out.${d2}.log

你可能感兴趣的:(logs脚本)