I have a directory where lots of cached files are getting generated very quickly. Since these are very small files, it is consuming all my inodes very quickly.
Currently I am running the following command to find all the files older than 12 hours and delete them.
$ find ./cache -mtime +0.5 -exec rm {} \;
But the rate at which this command is deleting is slower than the rate at which files are being generated. Can someone tell me some alternative way to remove large number of files quickly.
mtime
is more than 12 hours, right? If the files are generated very quickly, then you probably need to delete more recent files than that. – Joseph R. Oct 21 '13 at 09:20\;
with a+
or better use-delete
as you seem to be using GNU find. – Stéphane Chazelas Oct 21 '13 at 12:48