Web Hosting Talk







View Full Version : Cron is being difficult


fbsd4me
04-22-2002, 08:58 PM
This is frusterating.

I can run this script from the command line (./config.pl) and it works fine. But if ran by cron, it keeps returning a cryptic error.

Can't locate webtester.pl in @INC (@INC contains: /usr/lib/perl5/5.6.1/i686-linux /usr/lib/perl5/5.6.1 /usr/lib/perl5/site_perl/5.6.1/i686-linux /usr/lib/perl5/site_perl/5.6.1 /usr/lib/perl5/site_perl/5.6.0 /usr/lib/perl5/site_perl .) at /home/jim/public_html/cgi-bin/config.pl line 13

Config.pl calls webtester.pl, (the accompanying script), and again, everything works as it should when it’s called from the shell. As soon as I try and cron it, here come all the erroneous errors with some nonsense about not being able to find the webtester.pl file. I’ve even tried creating a cron.sh file, which will call config.pl. Again… Works from the shell, but chokes in crone. Why would it work fine from the shell, but not so when called by cron?

I’d be willing to entertaining any suggestions right about now.

Thanks

rfxn
04-22-2002, 09:24 PM
Thats an odd error indeed - it stumps me :confused:

fbsd4me
04-22-2002, 09:27 PM
Yeah, no doubt. And I thought it was just me :rolleyes:

priyadi
04-22-2002, 10:10 PM
I would guess that webtester.pl is located in the same directory as config.pl. If that's the case, you need to 'cd' before executing config.pl, like this example:

* 3 * * * cd /some/directory/ ; ./config.pl

fbsd4me
04-22-2002, 10:24 PM
COOL man, it works!

Thanks priyadi, appriciate that!