httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eric Ladner <eric.lad...@gmail.com>
Subject Re: [users@httpd] rotating log files
Date Sat, 25 Dec 2004 13:46:37 GMT
It would be a separate shell script that you'd run every night or on
Sunday or whatever...

If you want something where you can save logs for late processing for
a greater length of time:

dt=$(date '+%Y%m%d')
mv access_log access_log.$dt
mv error_log error_log.$dt
apachectl graceful
sleep 600
gzip access_log.$dt error_log.$dt

This way, you'll end up with date stamped log files.

On Sat, 25 Dec 2004 20:46:27 +0800, David Wong <amdawong@starhub.net.sg> wrote:
>  
>  
> 
> Hi guys, 
> 
>   
> 
> I am quite new to the HTTP server. I was making some efforts to understand
> how to do log files rotation. I read the documentation on rotating log
> files. 
> 
> There is an example of doing it this way 
> 
>   
> 
> mv access_log access_log.old
>  mv error_log error_log.old
>  apachectl graceful
>  sleep 600
>  gzip access_log.old error_log.old 
> 
>   
> 
> Do I write this in the configuration file or is it a separate script I have
> to write? 
> 
> Regards, 
> 
> david 


-- 
Eric Ladner

---------------------------------------------------------------------
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
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message