in reply to Detecting running from cron?

I think the simplest way to tell whether you're running from cron is to set an environment variable in the crontab, and then check for the existence of that variable in the script.

crontab:

CRON = 1 15 * * * * myscript.pl
script:
#!/usr/local/bin/perl if ($ENV{CRON}) { print STDERR "Running in cron.\n"; } else { print "Not running in cron.\n"; }
Of course, that depends on the variable being set in the crontab file.