欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

shell_删除过期日志

程序员文章站 2022-07-12 21:48:10
...
#! /bin/bash
#############################################
# Scripts for delete expire loggs
# Written by toptreegzh
# at 2010-08-04
#############################################

currDate=`date -d today +"%F %r"`
baseLogPath=/home/Gzh/shell/
weblogPath=/usr/local/OA/jboss-cw-oa/logs/

find "${weblogPath}" -mtime +2 -type f -name "catalina.out.*" >> ${baseLogPath}del_expire.log
find "${weblogPath}" -mtime +2 -type f -name "catalina.*.log" | xargs rm -rf
find "${weblogPath}" -mtime +2 -type f -name "catalina.out.*" | xargs rm -rf

echo "delete expire log successfully at ${currDate}" >> ${baseLogPath}del_expire.log

 

相关标签: JBoss Bash F#