Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Click here to return to the 'Automatically empty Apache error log files' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Automatically empty Apache error log files
Authored by: GEllenburg on Oct 04, '04 04:33:51PM

You need to restart Apache after doing this hint.

Apache keeps the log-files open (at the file-descriptor level), so while you may have effectively overwritten the file, the disk space is continuing to be consumed because the inode that the file references is still locked opened by Apache.

Just append an "apachectl graceful" to the end of your command to restart apache.

Alternately, somebody else mentioned the rotatelogs script, which is a much cleaner and effective way of maintaining your access_log and error_log files.

He who does not challenge one\'s elected decisions today, may find himself challenged by them tomorrow.

[ Reply to This | # ]