[TriLUG] Web Usage Tracking...
jeremyp at pobox.com
jeremyp at pobox.com
Fri Sep 28 09:35:09 EDT 2001
On Fri, 28 Sep 2001, Jon Carnes wrote:
> script on the hour. <That script runs for an hour collecting data.> The
> same cron job then kills all processes running that script *except* for the
> latest process - the one that just kicked off.
>
> At the end of the day, I have 24 log files, each with one hours worth of
> data. There is some overlap in the data, but its fractional compared with
> the vast quantities in each file - and if I wanted to be a stickler, I
> could easily write a script to compare consecutive log files and hack off
> the few duplicate entries from the end of each file that exist.
You know, you could make this really cool by having your script run
continuously, and trap the HUP signal to close and re-open the logfile,
like apache or numerous other daemons. Then you could rotate the logs
with logrotate, like you do other logs, and that would eliminate the
duplication problem. You could even kick off a secondary script to do
some analysis on the logs from logrotate.conf.
When you're done, GPL it and let us all use it too. :)
--J
More information about the TriLUG
mailing list