I want to make some space on disk and clean
What file & folders are safe to delete?
I found /media/import/ files are safe to delete
Deleting files and folder effect performance too?
Is it okay to delete '/www/media/catalog/product/cache'?
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It only takes a minute to sign up.
Sign up to join this communityYou can safely delete the files in the following folders:
Besides of that you can also remove old session files by using find /path/to/magento/var/session -name 'sess_*' -type f -mtime +7 -exec rm {} \;
Removing old session files can already have a performance impact.
For improving the performance of you Magento installation there is even more you can do than just deleting old and unnecessary files.
While it's ok to remove /www/media/catalog/product/cache
it's where Magento stores resized images and doing it on a live site will cause a slowdown while Magento recreates all those cached images so it doesn't have to recreate them 'on the fly' whenever it needs to serve them out.
It's better to expire out cached images older than X days as removing product doesn't remove images.
Command line to clear out any cached images older than 6 months:
find /path/to/magento/media/catalog/product/cache/* -type f -mtime +180 -exec rm -f {} \;
Another cleaning technique is to download the Image Clean
module from Magento Connect. Magento doesn't remove gallery images when product is deleted so you can have a horrific amount of junk images left if you have a lot of items you sell with a short product selling lifetime.
Also, make sure you have cron jobs set up properly as part of your disk space can be eaten up in storage of log_ tables in the database and if the log cleaning isn't functioning, the database grows immensely.
media/import
folder and rm -rf /path/to/magento/var/import_history/*.csv
Nov 2, 2018 at 11:13
In addition to @mhauri's answer I'd like to add:
Check your var/log directory if the system.log or exception.log files are big. You should have a look at the issues in there before you empty the files.
Cache and Sessions accumulate. Sometimes so much they can't be deleted from "within" the folder. Deleting the whole folder works but new folders must be put back into place and critical to duplicate original ownership and permissions so check before deleting
from within /magento/var/ directory rm -rf session rm -rf cache