Chinaunix首页 | 论坛 | 博客
  • 博客访问: 178165
  • 博文数量: 29
  • 博客积分: 2115
  • 博客等级: 大尉
  • 技术积分: 320
  • 用 户 组: 普通用户
  • 注册时间: 2008-04-01 18:15
文章分类

全部博文(29)

文章存档

2013年(1)

2012年(1)

2011年(5)

2010年(18)

2009年(1)

2008年(3)

我的朋友

分类:

2010-09-03 17:57:48

#!/bin/bash
DelDateFile=`date -d '-10 day'  +%Y-%m-%d`
DirN=(/opt/dicc/logs /opt/dicc/jboss4.0.5.ccr/server/default/log )
for DirName in ${DirN[@]}
   do  
   find $DirName -type f|grep $DelDateFile > /tmp/DelLogFile
   if [ ! -f /tmp/DelLogFile ]
      then exit 1
   fi
   for FileName in `cat /tmp/DelLogFile`
      do
         rm -rf $FileName
      done
done

#要删除的文件名和要DelDateFile有匹配字符串

阅读(1250) | 评论(1) | 转发(0) |
0

上一篇:python,a new begining

下一篇:NFS固定端口配置

给主人留下些什么吧!~~

chinaunix网友2010-09-06 14:40:17

Download More than 1000 free IT eBooks: http://free-ebooks.appspot.com