We have a cache folder, that accidentally grow large enough that it break the server. We have 8 GB RAM on server, and when I run simple rm
command to delete all files within it consume all of RAM and still do not delete it after 5 hrs.
So, we try to use find
but it fails too after 12 hrs of operation. Now from last 24hrs a find
with perl
statement is running, and the folder is still not delete in fact not a single file is deleted.
When we ls
the parent folder, it shows folder size around 1GB
, I just wonder how many million files are there.
So, my question, Is there any way we can delete files without listing them, so it just delete folder or files within without making a list (aka do not call getdir()
like system calls)
I am really considering formatting the server to get rid of it now.
EDIT:
I have used find
with -delete
and with -exec rm -f {}
EDIT2:
Based on this article we are running the perl command right now (well it is about 24+ hrs that command is still running), but nothing is been done in folder size visible to us.
nice -n 18
(or whatever) before you can decrease the CPU requests. Note that In one of the comment it is statedrm -rf directory/
it also works faster for billion of files in one folder...