|laziness, impatience, and hubris|
Rotating output from the Perl debuggerby Booger (Pilgrim)
|on Apr 20, 2005 at 16:34 UTC||Need Help??|
Booger has asked for the
wisdom of the Perl Monks concerning the following question:
I have a situation where I must debug a long running Perl process that is crashing once a week. I'm using the Perl debugger to accomplish this.
The problem is that the output from the Perl debugger is very large, size-wise, and since the Perl process is long running it is highly desirable that I rotate the log every couple of hours and compress old log files.
My usual methods of cat /dev/null > debug.log and echo > debug.log do not appear to be working properly; I assume this is because the file remains opened & locked by the Perl debugger? Is there another way to do this properly?
I suspect that this may not really be a Perl issue and more of a file-locking thing, however I'm curious to know if anyone has bothered to tackle this sort of thing before. Any suggestions or comments would be greatly appreciated!
Thanks in advance! boogerUpdate:
FWIW, the line I'm using to invoke the Perl debugger looks something like this:bash$ PERLDB_OPTS="NonStop LineInfo=debug.log frame=4 AutoTrace" perl -d script.pl --daemon
Resolved! Thank you everyone!