httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jacob Coby" <jc...@listingbook.com>
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`.

-Jacob
http://www.listingbook.com


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