I host my website at GoDaddy. I have a 9GB log file that I want to delete. I've logged in via SSH as root.
How do I delete the log file?
Filename Size Last modified birja-vdv.az_access_log 9 GB 2:20 AM
Try this command
The answer will be something like
You could then
However, if your web-server is holding the log-file open, the actual file does not get deleted until the web-server closes the log file. You should get the web-server to close and re-open it's log files. With thye Apache webserver you may be able to restart it using a command such as
As Silviu suggests most people prefer to set up something like
I'd check GoDaddy's help pages before proceeding. They are a very big hosting company and will very likely have some easy means for you to manage log files (perhaps through a web control-panel)
Your log files are most likely at
Once there, do a file listing (
If cleaning up /var/log doesn't help you (delete enough files), look up what uses most of your hard drive with "
My guess is that you want to delete your apache log files. Even if you will delete them now, it's good practice to use:
You can check more here.