delete files in a folder older than x minutes via terminal

125 views Asked by At

I want to repeatedly delete files from a folder that are older than some minutes. the reason behind it is a webcam, that constantly delivers jpegs to a folder. that folder is "watched" by an ftp program which mirrors all changes made - also the deletion.

so I tried

find Documents/GoProUpload/* -iname "*.JPG" -ctime +120s -print0 | xargs -0 -n1

as well as -atime and -mtime, but nothing is printed. i also checked the same command without the -ctime parameter and then i get all the files.

I also tried it with -mmin:

find Documents/GoProUpload/* -iname "*.JPG" -maxdepth 1 -mmin +2

but also nothing. why could that be?

0

There are 0 answers