#! /usr/bin/env bash now=$(date +%s) for f in /volume1/video/FTP/2???.??.??.*; do s=$(date -r "$f" +%s) if ((now-s > 60*60*24)); then rm -f "$f" fi done