in reply to Perl & cron job environmental variables
Jobs run from cron do not run under your login environment so yes, you'll seem to be missing a bunch of environment variables. Either explicitly set them in the crontab (which may depend on your particular OS' cron implementation), write a wrapper script which (say) sources your "normal" shell configuration file (e.g. ~/.cshrc or ~/.bashrc or what not) and then that is what runs your Perl, or set them explicitly with $ENV{FOO}="/bar/baz/quux"; statements in your code.
And to fend off the likely next posting: don't try just doing system( "source ~/.cshrc" ) in your code; it won't work.
|
---|