As mentioned in title, i'm trying to delete files that are older than one day inside a directory with many many files (without actually deleting the said directory) - the directory is backed up by a remote rsnapshot server so i don't need the source files anymore as soon as they're backed up, the problem is that
find /directory/* -mtime +1 -delete
gives an error 'argument list too long' since there are that many files (they're not even that big, it's just a lot of pictures and small videos from a security camera working with motion software - which is great by the way ;)
I've stumbled over this command that i could use with crontab:
perl -e 'for(<~/test1/*>){((stat)[9]<(unlink))}'
but i don't really understand this command, as i understood it's some kind of loop. It did actually work on a test directory i created (test1 obviously) with a bunch of test files that were all younger than one day, i don't think that the 'older than' argument is even in here..
How would i go about that? Feel free to modify my question if it's not clear.