httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "RuneImp" <r...@imptech.net>
Subject Re: Cleaning log files
Date Wed, 13 Mar 2002 09:36:16 GMT
I use a croned shell script after all logs have been
processed by PerlFect DailyStats.

All logs are place within this type of directory
structure.

/usr/home/domainname.tld/web/logs/access.log
/usr/home/domainname.tld/web/logs/error.log

This is the script:

#!/bin/sh
for file in /usr/home/*/web/logs/*.log; do
        echo Trimming $file
        tail -5000 $file > temp
        mv temp $file
done
/usr/local/sbin/apachectl graceful


Is this a bad practice?


-=- RuneImp
ImpTech - Web Design, Hosting & Computer Tech
http://imptech.net
rune@imptech.net


----- Original Message ----- 
From: "Artiom Morozov" <artiom@phreaker.net>
To: <users@httpd.apache.org>
Sent: Wednesday, March 13, 2002 1:14 AM
Subject: Re: Cleaning log files


depends on how you're transferring logs to files, but in general - it's 
not. use logrotate(8) or rotatelogs from apache distribution.

On 2002.03.13 11:02 Dror Braznitzki wrote:
> Hello,
> 
> Is it safe to clean log files using 'cat /dev/null > log_file' while
> the
> server is running ?
> Is there a better way of doing it ?
> 
> Thanx,


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message