#!/bin/bash # 设置文件保留时间为2天 DAYS=1 # 1代表大于1天,即2天 # 使用find命令查找所有符合条件的文件 find /home/pi/mp4 -type f -mtime +$DAYS -exec rm -f {} \;