Fleet wrote:
> RAQ2/mips webserver running Linux.
> Current log output is a file named "access." I want to grep (or otherwise
> parse out) a single (previous) days log entries to a file named after the
> appropriate date (ie, access-19991105), then I want to REMOVE the previous
> days entry from the current log file ("access") so that only current days
> entries remain (and get added to.)
>
> Apparently getting the log restarted on a daily basis (especially with a
> new date name) requires stopping Apache while the date string is updated,
> nameing the file, then restarting Apache. My approach is to 'steal' the
> old day's data, then lop off the tail of the access log file while it
> continues to collect current days data. As long as the file/file handle
> relationship remain the same, I think this will work.
Don't think you can chop off the front part of a file in the way you
want to... (Somebody is welcome to prove me wrong.)
I'd suggest a root cron job running at 0 0 * * * instead that:
#!/bin/csh
mv /usr/local/apache/log/access.log /usr/local/apache/log/access.log.`date +%y%m%d`
/usr/local/apache/bin/apachectl restart
(Sorry to the list that this isn't a REBOL solution, but it seems a
much easier way to accomplish this result... and simpler *is* the
REBOL way!)
Cheers,
Kev
------------------------------------------------------------------------
Kevin McKinnon, Network Engineer [EMAIL PROTECTED]
Sunshine Communications http://www.sunshinecable.com
**NOTE NEW E-MAIL ADDRESS**
PGP Public Key: http://www.dockmaster.net/pgp.html PGP 6.0 www.pgp.com