删除几天前的文件(CleanDir:删除目录) find CleanDir -mtime +7 -type f -exec rm -rf {} \ // 删除7天前的 rmdir -p $CleanDir // 删除为空的目录