I've looked at
this question which is basically my exact situation, but I can't get any of the solutions described too work without killing the system.
I've tried:
rm -rf mydir
nice rm -rf mydir
nice -n 19 find mydir -type f -exec rm -v {} \;
nice -n 19 rm -rf mydir&
And many other combinations of rm, find rm, nice find rm, etc, but all cause the server load to rise to dangerous levels quickly (I kill the process when `top` hits 20, I'm assuming the machine would hang if allowed to continue).
So is it possible to remove a directory with a lot of files without killing the server?
find mydir -type f -print0 | perl -0 -MTime::HiRes=sleep -ne 'unlink; sleep .1;'posted by nicwolff at 9:56 AM on April 10, 2008