Actually, you wouldn't want to do that, as the logfile would be written over every time the cronjob ran. You'd probably want to do something liike this:
date >> logfile && perl -d (your script here) 2>&1 >> logfile
The >> will append to the logfile rather than overwrite it, and the 2>&1 redirects stderr to stdout, assuming you are running bash. I'm not sure of the syntax for tcsh/ksh/csh/etc, but i'm pretty sure that there will be more useful debugging info in stderr than in stdout.
BlueLines
Disclaimer: This post may contain inaccurate information, be habit forming, cause atomic warfare between peaceful countries, speed up male pattern baldness, interfere with your cable reception, exile you from certain third world countries, ruin your marriage, and generally spoil your day. No batteries included, no strings attached, your mileage may vary. | [reply] [d/l] [select] |
i'm pretty sure that there will be more useful debugging info in stderr than in stdout
While your suggestion of duping stderr to stdout is a good one, my chief concern was capturing the output of the debugger, sent to stdout, the last line of which would be the line which caused the segfault.
--
Ryan Koppenhaver, Aspiring Perl Hacker
"I ask for so little. Just fear me, love me, do as I say and I will be your slave."
| [reply] |