#!/bin/bash
FILE_DRI='/u01/backup/'
#在/u01/backup/目录及子目录中查找更改时间1日以前的文件并删除它们:
# find /u01/backup/ -type f  -mtime +1 -exec rm {} \;
for file_bk in $(find $FILE_DRI -type f -mtime +1);
do
 file_size=$(du -sh $file_bk | awk '{print $1}')
 rm -rf $file_bk >/dev/null 2>&1
 if [ ! -f "$file_bk" ]; then
	 rm_date=`date +"%F %T"`
	 echo "$rm_date | $file_bk | $file_size 已删除"  >> /home/rm.log
 else 
     rm_date=`date +"%F %T"`
	 echo "$rm_date | $file_bk | $file_size 删除失败 " >> /home/rm.log
 fi
done