httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bob Ramsey <>
Subject Re: rotate logs
Date Fri, 23 Aug 2002 14:15:43 GMT
I'm actually looking at a similar problem.  What I want is to have 
access_log with data for the previous 3 months, and then individualized 
month archives before that.  So today I would have access_log.052002, 
access_log.042002, etc., and an access_log that contained entries from June 
1, 2002 to today.  On Sept 1, the June entries get archived out of the 
access_log into access_log.052002 and the log will have 
July-September.  This is more complicated than what most people do.

But on to your code example.  I tried it out, and as I thought, the touch 
doesn't automatically 0 out the file.  At least on my Mandrake development 

However, there is another way to zero out the access_log file without 
having to restart apache.  WARNING:  this has worked for me on my 
development server.  I have not tested it extensively nor I have I used it 
in a production environment.  For all I know, your server could explode in 
a ball of bright blue flames if you do this.

Anyway, I did:

touch blank
cat blank > access_log

Touch creates a new blank document and piping the cat output into 
access_log deletes all the current entries without breaking the open file 
handle that is in use by apache.  At least on my dev server this works.


Bob Ramsey                                      Computer Consultant II
ph:  1(319)335-9956                              216 Boyd Law Building
fax: 1(319)335-9019                  University of Iowa College of Law                Iowa City, IA 52242-1113
For Hardware and Software questions, call 5-9124

The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message