Report this

What is the reason for this report?

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

Posted on April 9, 2016
Stew

By Stew

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



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

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.

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

It’s important to proceed with caution, as deleting critical system files can cause problems.

Old log files can accumulate and take up space. You can delete or compress old logs.

sudo find /var/log -type f -name "*.log" -delete 
sudo find /var/log -type f -name "*.log.*" -delete

You can also follow this tutorial

https://docs.digitalocean.com/support/how-do-i-fix-disk-space-issues-on-my-droplet/

Regards

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.