Apache Log files - rotate and delete???

Apache Log files - rotate and delete???

Post by Ben Thoma » Tue, 06 Jul 1999 04:00:00



Hi all,

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...

 
 
 

Apache Log files - rotate and delete???

Post by Alex Brow » Tue, 06 Jul 1999 04:00:00



> Hi all,

> Is it possible to configure Apache to remove old log files after it rotates them
> to another filename?

Apache won't do this - you need a shell script for the job.

A.

--
Alex Brown
Webmaster, Cable Internet

Conformity is futile.
www.ihatestarwars.com

 
 
 

Apache Log files - rotate and delete???

Post by Michael Rudolp » Tue, 06 Jul 1999 04:00:00


I'm not sure, if it is possible with apache, but I wrote a small
shellscript, that ist run daily (e.g. at 2 o'clock in the morning) by cron
as user root:

cd /usr/local/apache/logs
size=100;
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`;
fi

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
files.

Michael Rudolph


Quote:>Hi all,

>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...

 
 
 

1. why are rotated log files deleted?

Hi,

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,

Julian

--
--
Julian Wood

Multimedia Developer
University of Calgary

2. ANY ONE USING LCS-8880 MULTIPORT SERIAL CARD?

3. How to rotate log files, apache and mod_ssl?

4. Puzzler: ide DVD-ROM stopped to work in 2.4.20 (Slackware 8.0something)

5. apache log directory, restarting server after rotating logs.

6. running as a different group

7. How do I delete Apache Log Files

8. Making disc bootable

9. Rotating apache logs

10. Apache Log Rotate

11. Rotating Many Logs for Virtual Domains with Apache

12. Rotate and Reset Apache Logs

13. Apache logs rotate