httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jacob Coby" <>
Subject Re: rotate logs
Date Fri, 23 Aug 2002 14:26:37 GMT
> 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.

A simpler solution would be:

cp access_log access_log.`date -I`
cat /dev/null > access_log

That will copy your current access log to "access_log.2002-08-23", and then
zero it out without any temporary files.

note that those are backticks, not single quotes in the `date -I`.


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