[Zope] Purging Z2.log

Gilles Lenfant glenfant@bigfoot.com
Thu, 8 Nov 2001 18:21:56 +0100


I use this script.
You can replace 400 by the number of lines you want to keep.
You can put in in your crontab too

<script>
#!/bin/sh
VARDIR=/var/zope
tail -n 400 $VARDIR/Z2.log > $VARDIR/newZ2.log
mv $VARDIR/newZ2.log $VARDIR/Z2.log
</script>

Other option: you could use the logrotate facility too (man logrotate)

HTH

--Gilles

----- Original Message -----
From: "Pieter Claerhout" <Pieter_Claerhout@CreoScitex.com>
To: <zope@zope.org>
Sent: Thursday, November 08, 2001 12:12 PM
Subject: [Zope] Purging Z2.log


> Hello,
>
> is there an easy way to purge the logfile without stopping the Zope
process.
> I'm using AWStats for the statistics of my website, and have it sheduled
to
> run every hour. Since it only processes the new lines, I would like to
purge
> the logfile after each update of the statistics, to speed up the
processing.
> Of course I don't want to stop Zope to do so.
>
> Is there a trick to do this?
>
> By the way, anyone ever thought of a Zope based statistics software?
>
> Cheers,
>
>
> Pieter
>
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )
>