Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I delete records in an active log file "in -place"

Status
Not open for further replies.

kat000003

Technical User
Jan 27, 2005
37
0
0
CH
I have an active log file with date records in it.
I want to delete all records prior to a given date BUT I need to do so "in-place" because the file is currently being written to ?
If I use standard awk or head|tail commands, I lose records that get written at the time of the cleanup.
 
Since you haven't received any answers here's my tuppence-worth.

It seems clear you have two choices - either you stop writing to this file whilst you do your housekeeping on it OR store the log records in a database instead. Assuming you're using UNIX or a derivative some of these already come with a built-in database system that, although simple, might meet your needs.

Try man dbm for more info.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top