首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 其他教程 > 操作系统 >

shell_剔除过期日志

2014-06-10 
shell_删除过期日志#! /bin/bash############################################## Scripts for delete exp

shell_删除过期日志

#! /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.logfind "${weblogPath}" -mtime +2 -type f -name "catalina.*.log" | xargs rm -rffind "${weblogPath}" -mtime +2 -type f -name "catalina.out.*" | xargs rm -rfecho "delete expire log successfully at ${currDate}" >> ${baseLogPath}del_expire.log

?

热点排行