Question

Free hd space by deleting useless files and folders like access log, error log and more

Posted April 9, 2016 2.4k views
Ubuntu Apache LAMP Stack

Hello wiich is the useless files and folders i can delete for free hd space?
Thank you

4 comments
  • in general, i don’t recommend deleting the access nor error logs as they can helpful for troubleshooting issues. If they are several GB in size for some reason, then i suppose a case can be made to delete those files for some immediate free space.

    Instead, I usually recommend using logrotate to keep the logs under control. A general tutorial on using logrotate for Apache is at this link

    by Justin Ellingwood
    Apache can be configured to log a large quantity of information to help you diagnose problems and keep an eye on activity. In this guide, we will discuss how Apache handles logging and how you can create your own custom logging rules and rotation schemes.
  • thank you, another question, when update/upgrade system i’ll need delete old packeges for free space? and how i can do it securly?

  • for red hat and centos systems, you could execute yum clean all, although my personal experience is that the local yum cache directory isn’t usually that big.

  • ok thank you however i am on ubuntu

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

1 answer

This question was answered by @SphericalCow:

in general, i don’t recommend deleting the access nor error logs as they can helpful for troubleshooting issues. If they are several GB in size for some reason, then i suppose a case can be made to delete those files for some immediate free space.

Instead, I usually recommend using logrotate to keep the logs under control. A general tutorial on using logrotate for Apache is at this link

View the original comment

by Justin Ellingwood
Apache can be configured to log a large quantity of information to help you diagnose problems and keep an eye on activity. In this guide, we will discuss how Apache handles logging and how you can create your own custom logging rules and rotation schemes.
Submit an Answer