[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Rotating logs (and keeping the log's tail)



Hello,

I use a wiki engine that produces an event log, which I want to rotate.

Because the event-log is used to display the "PageHits", I don't want to
truncate the log every Monday. I wish the log could contain the last
week, plus the current week, so the statistics are never empty.

The scenario would be:

On The 2nd Monday: store the last line of the log (i.e "tag" it)

On the next Mondays: 
 * Save the top of the file (above the tag)
 * Delete the top of the current log.
 * Update the tag (to the bottom of the log file).

I afraid there's probably no perfect tool to perform that (because it
can't be atomic)... But I wanted to ask before updating the code to
parse two log files.

Thanks,

Franklin

[Please CC me, I am not subscribed to this list]

-- 
Stop Software Patents - http://ffii.org/
Sign the petition at http://stopsoftwarepatents.eu


Reply to: