Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 17 May 1999 21:30:33 +0100
From:      Stuart Henderson <stuart@eclipse.net.uk>
To:        ndear@areti.net
Cc:        freebsd-isp@FreeBSD.ORG
Subject:   Re: Web Statistics break up program.
Message-ID:  <37407C69.97BAAE5C@eclipse.net.uk>
References:  <199905172017.VAA08078@post.mail.areti.net>

next in thread | previous in thread | raw e-mail | index | archive | help
"Nicholas J. Dear" wrote:
> 
> Hi,
> 
> We currently use Analog to generate our stats, but now customers 
> are asking for weekly, or monthly stats to be generated, rather 
> that just one accumulative lot. Is there anyway to automatically 
> break up the stats, and have them to put into its own html stats 
> file.

how about this for starters:

TODAY=`date +%Y-%m-%d`
THISMONTH=`date +%Y-%m`
cd /usr/local/www/logs
mv httpd-access.log httpd-access.log.$TODAY
mv httpd-error.log httpd-error.log.$TODAY
analog < httpd-access.log.$THISMONTH*

> Also, something to delete logs after a certain period would 

If you rename them like above then it is a simple matter.
Alternatively you can learn the syntax to find(1), which is 
probably a lot more useful in the long run but might require
a few coffees and a printed copy of relevant docs if you've 
not used it before ;-)


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-isp" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?37407C69.97BAAE5C>