http://www.perlmonks.org?node_id=1060312


in reply to Need help on tomcat restart via cronjob

Hi,

IMHO not really a Perl related question. It's more one of the recurring questions, why a script is not working under cron when it is working in a terminal. And this has to do almost always with environment variables not being set properly while running under cron.

IMHO the simplest solution for that is calling the job in cron this way:

bash -l -c "perl $path_to_perlscript/someperlscript.pl arg1 arg2"

UPDATE: This shall show the idea behind. It depends on the shell used.

Best regards
McA