Is it possible to configure Apache to remove old log files after it rotates them
to another filename?
Ben Thomas - Melbourne, Australia
22 - '98 Nissan Pulsar SLX sedan
One good turn gets most of the blankets...
> Is it possible to configure Apache to remove old log files after it rotates them
> to another filename?
Webmaster, Cable Internet
Conformity is futile.
size1=`du -a access_log | cut -f1`;
if [ $size1 -gt $size ]; then
mv access_log access_log.old;
mv error_log error_log.old;
kill -USR1 `cat httpd.pid`;
With this script, it is tested, if the logfile access_log has reached a
certain size (100 blocks). If yes it is moved to access_log.old, as well as
error_log. So this is a kind of rotation and you always have access to older
>Is it possible to configure Apache to remove old log files after it rotates
>to another filename?
>Ben Thomas - Melbourne, Australia
>22 - '98 Nissan Pulsar SLX sedan
>One good turn gets most of the blankets...
I'm running Apache, and piping the customlog directive to rotatelogs,
which rotates them once a day. The thing, is they are deleted after 1
week (7 files). What is doing the deleting? I actually would prefer
about a 1 month tally of logs before deleting. I can't find any
documentation on why it deletes after 7 days.
Thanks in advance,
University of Calgary