#!/bin/bash
location="/root/sqlbak/"
find $location -mtime +30 -type d |xargs rm -rf #删除目录
find $location -mtime +30 -type f |xargs rm -f #删除文件
find $location -mtime +30 |xargs rm -rf #删除目录及文件
find $location -mtime +30 -name "*.gz" | xargs rm -f #还可以做过滤后删除