claree0 has asked for the wisdom of the Perl Monks concerning the following question:
I'm currently performing a lot of manipulation of log files, which grow by up to 100MB/day. The records in the files are of the format
date/time logentry
and I want to be able to trim out the older records. Currently, I do this by reading the file line-by-line, and writing out the lines after $arbitrary_data to a temporary file, which is then used to replace the current log file.
This takes a considerable amount of time to process, so any suggestions for a more efficient method would be very gratefully received.
|
---|
Replies are listed 'Best First'. | |
---|---|
Halve the difference
by tachyon (Chancellor) on Aug 22, 2001 at 15:39 UTC | |
by tachyon (Chancellor) on Aug 22, 2001 at 19:17 UTC | |
by VSarkiss (Monsignor) on Aug 22, 2001 at 18:49 UTC | |
by tachyon (Chancellor) on Aug 27, 2001 at 11:18 UTC | |
Re: Removing old records from log files
by tachyon (Chancellor) on Aug 22, 2001 at 14:56 UTC | |
Re: Removing old records from log files
by idnopheq (Chaplain) on Aug 22, 2001 at 14:19 UTC | |
by claree0 (Hermit) on Aug 22, 2001 at 14:28 UTC | |
Re: Removing old records from log files
by Zaxo (Archbishop) on Aug 22, 2001 at 14:21 UTC | |
by claree0 (Hermit) on Aug 22, 2001 at 14:31 UTC | |
Re: Removing old records from log files
by BazB (Priest) on Jan 16, 2002 at 20:44 UTC | |
Re: Removing old records from log files
by John M. Dlugosz (Monsignor) on Aug 23, 2001 at 10:41 UTC |
Back to
Seekers of Perl Wisdom