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