Execessive amount of files on server. How to clean up

Permalink
So I get this message when I login to cPanel:

"Your account contains more than 9740 directories and may pose a potential performance risk to the server.
Please reduce the number of directories for your account to prevent possible account deactivation."

How to remove unnecessary directories/files?

I know we don't need that many files/directories. So there must be duplicates/temporary, etc. Do I remove them through ftp? How to make sure I don't delete something that is actually part of the website?

TIA

 
jvansanten replied on at Permalink Reply
Files tend to be stored in unique folders, so that could be an issue if you have many.

Other than that, what's the setup?

Do you have multiple sites running? Is this a clean C5 install? How long has it been running? Have you upgraded C5? What other info can you provide about your setup?
jshannon replied on at Permalink Reply
jshannon
Many of these files/directories are, in fact, necessary. Yes, there are a lot, but I wouldn't recommend deleting any of them, except:

1. Cache / tmp files. But some/many of these will just get regenerated.
2. Old versions. If you've upgraded, and you have one or more versions in /updates, then that means that you probably alos have previous core directories around that you can get rid of.
RobinMeade replied on at Permalink Reply
Below are the directories with most files. I know a lot of them are email accounts (I'm working on that) But how to reduce the very first "polutant" with over 4000 files!?

TIA

4118 : /home5/bol1/public_html/files/cache
2171 : /home5/bol1/mail/bol.com/lars/cur
1481 : /home5/bol1/mail/bol.com/karen/cur
775 : /home5/bol1/mail/bol.com/mike/cur
568 : /home5/bol1/mail/bol.com/mike/.Sent/cur
494 : /home5/bol1/mail/bol.com/sean/cur
489 : /home5/bol1/mail/bol.com/amanda/cur
476 : /home5/bol1/public_html/updates/concrete5.6.1.1_remote/concrete/libraries/3rdparty/Zend/Locale/Data
476 : /home5/bol1/public_html/updates/concrete5.6.0.2/concrete/libraries/3rdparty/Zend/Locale/Data
476 : /home5/bol1/public_html/updates/concrete5.5.2.1/concrete/libraries/3rdparty/Zend/Locale/Data
476 : /home5/bol1/public_html/files/tmp/1363893520/concrete5.6.1.1_remote/concrete/libraries/3rdparty/Zend/Locale/Data
476 : /home5/bol1/public_html/files/tmp/1353513312/concrete5.6.0.2/concrete/libraries/3rdparty/Zend/Locale/Data
476 : /home5/bol1/public_html/files/tmp/1335428522/concrete5.5.2.1/concrete/libraries/3rdparty/Zend/Locale/Data
476 : /home5/bol1/public_html/concrete/libraries/3rdparty/Zend/Locale/Data
291 : /home5/bol1/mail/bol.com/john/cur
282 : /home5/bol1/mail/bol.com/sean/.Sent/cur
274 : /home5/bol1/mail/bol.com/amanda/.Sent/cur
209 : /home5/bol1/mail/bol.com/kimberly/.Sent/cur
150 : /home5/bol1/mail/bol.com/sales/cur
133 : /home5/bol1/mail/bol.com/diana/cur
123 : /home5/bol1/.cpanel/nvdata
115 : /home5/bol1/public_html/updates/concrete5.6.1.1_remote/concrete/images
115 : /home5/bol1/public_html/updates/concrete5.6.0.2/concrete/images
115 : /home5/bol1/public_html/files/tmp/1363893520/concrete5.6.1.1_remote/concrete/images
115 : /home5/bol1/public_html/files/tmp/1353513312/concrete5.6.0.2/concrete/images
113 : /home5/bol1/public_html/updates/concrete5.5.2.1/concrete/images
113 : /home5/bol1/public_html/files/tmp/1335428522/concrete5.5.2.1/concrete/images
111 : /home5/bol1/public_html/concrete/images
103 : /home5/bol1/mail/bol.com/kimberly/cur
jvansanten replied on at Permalink Reply
Files maintains files managed by the File Manager -- as one might suppose.

Typically, an individual directory is created for each file -- as a method of obfuscation, I assume.

You probably have a several step process ahead of you:
1. Identifying files that are no longer needed and documenting their location.
2. Deleting the file from the File Manager.
3. Removing the folder for that file.

Or, you could consider moving your site to a less restrictive host.
jshannon replied on at Permalink Reply
jshannon
This report is only somewhat helpful. I think it only shows the folders with a large number of FILES directly within that folder. So the /files/xxxx/yyyy/zzzz folders will never show up. That's definitely a concern, especially because of the large number of folders that are getting created. But, as jvansanten says, there's a lot of work in identifying which files in your file manager are no longer needed. After that, it should be easy enough to automate something that deletes empty directories.

But you REALLY need to deal with the old core directories first. Each one has something like 4300 files and directories. So clear those out, and you'll "save" at least 12000 files.
jshannon replied on at Permalink Reply
jshannon
You can safely remove the cache directory. If the files are needed, they'll be regenerated.

Also, I note that you have an updates/ directory. I mentioned this earlier as something to look at. It looks like you have at least 4 different versions of the c5 core. You can delete 3 of these. Take a look at what I wrote earlier.