Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

proper way to clean up /opt/apache/logs/access_log?

Status
Not open for further replies.

pzxkys

IS-IT--Management
Jul 18, 2000
24
US
Is there a preferred method for cleaning up /opt/apache/logs/access_log? If I rm the current access_log will apache create a new one automatically? Thanks!
 
Yes,you can backup your access_log to another harddisk/tape and delete the old access_log.If you still want to keep access_log.
 
Before copying, make zip file of it ( according to date) and then copy into removable disk.
this is my procedure.
 
Thanks. This is running on a production server that depends on apache ... so I don't want to break anything. You didn't quite say that the access_log will be automatically re-created by apache when I rm the old one. Will it? Sorry if I missed that. Thanks for your feedback!
 
I moved the apache access_log to my home dir in /home. When no new access_log was created (after an hour or so) I created an empty copy of a access_log. This access_log is not being updated by apache. Do I need to restart apache? Also: The 330+ mbyte access_log that I moved did not free up any free space on the / partition. I can see that it is now taking up space in /home (which is a separate partition)... so why does it look like it's still using space in /?

Thanks.
 
Looks like users of tek-tips should exercise caution when receiving advice from others :).

It turns out that the df -k command is apparently working properly on my linux box. The problem was that I rm'd the access_log file and should have cat /dev/null'd it instead. Apache didn't get it that the file was rm'd so it hung onto it ... somewhere in the system ... and the / partition numbers reflected the problem. Once I restarted apache the df -k output was fixed. Moral of the story : don't just mv the apache access_log! Also: don't believe anything you hear and only believe half of what you see.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top