in reply to Detecting running from cron?
Check for it in the script and direct output accordingly:CRON = 1 * * * * * scriptname
This will allow you to print normally, but it will be directed to STDERR using a redirect. The Camel Book has more detail on the "&" operator in the context of an open request, as does "perldoc -f open".BEGIN { open (STDOUT, ">&STDERR") if ($ENV{'CRON'}); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Detecting running from cron?
by turnstep (Parson) on Jan 23, 2001 at 21:27 UTC | |
by tadman (Prior) on Jan 23, 2001 at 23:33 UTC |