[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [cobalt-users] Raq3/4 Stats
- Subject: Re: [cobalt-users] Raq3/4 Stats
- From: "Jonathan Michaelson" <michaelsonjd@xxxxxxxxxxx>
- Date: Fri Dec 20 07:00:01 2002
- List-id: Mailing list for users to share thoughts on Sun Cobalt products. <cobalt-users.list.cobalt.com>
Maurice,
> When running this script, is produces stats with loginformation beginning
> today. I guess that comes because logrotate runs at night.
>
> Is it possible to have it produce stats once in a month, for a whole month
> completely?
The problem may be that your logs are being rotated because of its size,
rather than monthly. Here is an explaination for one of those, the web logs:
You need to check through the logrotate configuration files in
/etc/logrotate.d (probably the filed called apache) and look for the section
starting for /var/log/httpd/access. You need to remove any size rotation
directive and replace it with monthly. E.g. our /etc/logrotate.d/apache
directive reads (allow for possible line wraps):
/var/log/httpd/access {
prerotate
/usr/local/sbin/split_logs web < /var/log/httpd/access
endscript
compress
rotate 3
monthly
missingok
postrotate
/usr/bin/killall -HUP httpd 2> /dev/null || true
endscript
}
This rotates the access log for the whole server on the first day of the
month (monthly) and keeps 3 copies (rotate 3) of the resultant archive which
is a compressed file (compress).
Running it once a month might be tricky becuase you would need to ensure
that the job runs before the log is rotated. It would be simpler to rewrite
it to run on, say, the 2nd of every month and to copy the most recent
compressed archive, uncompress it, use the result as input then delete those
temporary files.
We run it daily to keep track of usage so that we can advise our customers
if they're approaching or likely to breach their data transfer limits and to
check them at the end of the month.
--
Regards,
Jonathan Michaelson
Commercial CGI Scripting, Web Hosting
Web-based Email, Homepage Creation and Live Help products
http://www.webumake.com