Hello Monks!

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!
booger

Update:

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!


In reply to Rotating output from the Perl debugger by Booger

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.