Oh, sure it's working. The Perl program *is* getting the
environment variable. However, the variable isn't set.
Programs run from cron have hardly any environment variables
set. And that makes sense. "HOME" is something associated with
a user logged on. A program run from cron isn't started by
a user - so there's no "HOME" environment variable.
You either need to set it explicitely yourself, or you should
write your program in such a way you don't need the variable.
Abigail | [reply] |
I get around this by writing my crontab as such:
0 0 * * * ssh yourhost yourscript
You could also use rsh if you were so inclined. The [r|s]sh in to your local machine creates a login shell, thereby setting the environment to what one might expect.
| [reply] |
Cron tasks are not shell sessions. You don't have the same environment. Your process has only the barest minimum environment setup, and that doesn't include $ENV{HOME} or other trivial niceties made by your .cshrc / .bashrc or other profile stuff.
-- [ e d @ h a l l e y . c c ]
| [reply] |