in reply to File Locking and other apps
In that case, you need to follow the previous advice: kill the current instance of the process, and restart it so that its log output is piped to some other process that will produce "rotation" log files. As indicated, log rotation scripts are already available, and of course, it could almost be as simple to cook up your own -- just decide what the rotation interval should be (hour, day, week) and how many intervals need to be kept at any given time (3, 7, 24, 31), come up with a suitable log file naming scheme, and have the rotation script delete the oldest file at each interval when it closes the current one and opens a new one.
On any unix-like OS, it should be possible to truncate a file even while some other process is writing to it. It can get messy, of course, depending on the nature of the output -- for a log file, probably the worst case would be ending up with a partial line at the beginning of the file.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: File Locking and other apps
by Anonymous Monk on Mar 07, 2006 at 02:35 UTC | |
by graff (Chancellor) on Mar 07, 2006 at 02:54 UTC |