On Thu, 16 Sep 1999, Tod Fishburne wrote:

> Hi!
> 
>      I am about to begin compressing log files and using Analog to report 
> on them and I thought I would see if anyone had some code I could use so I 
> don't have to re invent the wheel so to speak.  I am using Red Hat Linux 
> 5.1 with Apache Web Server. Here are my goals.
>            1.) I am hosting multiple sites and I would like to report on 
> each one individually. I will use cron to run analog on multiple cfg files.
> 
>             2.)I would like to archive the log file and run monthly (maybe 
> weekly) summary reports and put them on each web site I host 
> (www.site.com/log/july; www.site.com/log/august....). One of the tricks is 
> to get the month (by name or number) and use it in the path of the site.
> 
>      If anyone has code or suggestions it would be greatly appreciated. 
> Basically looking for helpsetting up cron and the cfg file to read the 
> compressed files dynamically. And cron jobs to compress the files for me. 
> Or a better way to do this that I haven't thought of. Thanks in advance.
> 

There is something called rotatelogs or logrotate distributed with Apache,
isn't there? Then again, writing your own might be just as easy, because
because none of the steps is difficult.

You need to know cron of course. Reading compressed files is easy with
analog's UNCOMPRESS command. Putting the date in a logfile name is pretty
easy to if you know Unix's (well, the shell's actually) backtick notation:
something like
  mv /logpath/logfile /oldlogs/logfile.`date +%m`
should do it. To rotate the logs, move them, then send SIGHUP to the server
(kill -HUP `cat /logpath/httpd.pid`). That's it, isn't it?

-- 
Stephen Turner    [EMAIL PROTECTED]    http://www.statslab.cam.ac.uk/~sret1/
  Statistical Laboratory, 16 Mill Lane, Cambridge CB2 1SB, England
  "Due to the conflict in Kosovo, we will not be showing the movie Wag the
   Dog. Instead, we will show Mortal Kombat: Annihilation." Cable & Wireless

------------------------------------------------------------------------
This is the analog-help mailing list. To unsubscribe from this
mailing list, send mail to [EMAIL PROTECTED]
with "unsubscribe analog-help" in the main BODY OF THE MESSAGE.
List archived at http://www.mail-archive.com/[email protected]/
------------------------------------------------------------------------

Reply via email to