On Tue, Dec 24, 2002 at 02:29:22PM +0100, Hauser Marcel wrote:

> Javier Gostling wrote:
> 
> >Not that tough. I have my squid log files rotate on a weekly basis with
> >compression enabled. For my monthly reports, I just create a big log
> >file by zcatting the old logfiles and catting the current logfile into a
> >temporary logfile to be processed.
> 
> yup... thought about that as well.. (by the way..i use sarg for the 
> squid processing).. but since i'am going to do daily, weekly and monthly 
> reports...including squidguard... i would have to do more scripting than 
> for the lock file solution :)

I also use sarg. I found the daily, weekly and monthly scripts that came
with it quite defficient, so I wrote my own scripts to do the same job.
None of the scripts are over 1Kb. in size. If there is interest, I can
post them to the list.

> 
> >>i thought abouth touching /var/lock/subsys/whatever while the reporting 
> >>tool is running.
> >>and to not execute logrotate if that file exists for that day!
> >I would rather have logrotate sleep until the lock goes away. That way
> >you jusr delay log rotation instead of making it go away completely.
> 
> what do you mean with sleep ? something like a do while loop checking if 
> the file still exists...??

Exactly.

while [ -f <lock file> ]; do
  sleep 300
done

Would check every 5 minutes.

> 
> >>is there no better solution?
> >Can you do partial data collection on a more frequent basis? Perhaps
> >weekly? That way your processing time should be drastically reduced.
> 
> i already do that actualy :) i do daily reports, separate weekly and 
> separate monthly reports :)

Ok. Another solution we use for our bigger servers is to have the log
files shipped off server periodicaly. then all processing happens in
this offline location, where logfile rotation is not an issue. This has
the added benefit of lightening the load on the servers.

Cheers,
-- 
Javier Gostling                        Av. Kennedy 5757, of. 1502
Ingeniero de Sistemas                  Las Condes, Santiago, Chile
Virtualia S.A.                         Fono: +56 (2) 202-6264 x 130
[EMAIL PROTECTED]                 Fax:  +56 (2) 342-8763

Attachment: msg100037/pgp00000.pgp
Description: PGP signature

Reply via email to