Quote:
Originally posted by fletcher
Use "logrotate" to do it. You have to send Apache an HUP signal after you remove it to make it create a new logfile.
|
Or...
To save your logs in a compressed format:
Code:
gzip -c logfile > logfile.gz && cat /dev/null > logfile
the above code for Linux I believe is:
gzip -c logfile > logfile.gz && echo -n "" > logfile
The thing is that if you remove or rename your logfile, Apache will no longer be able to write log information as it has lost the pointer to the file. The way to get around it is to zero it out as in the example above.. That way you wont have to restart the webserver.
