Deleting lots of tiny files really really quickly

This is the second half of that magento issue. Mainly, after having got a directory with millions of files in it, you can do one of two things.

mv sessions sessions_full && mkdir sessions && chown www-data:www-data sessions
rm -rfv sessions_full

Or

find /loc/of/sessions -ctime +1 -type f -exec rm -v {} \;

Leave a Reply

Your email address will not be published. Required fields are marked *