Home: Fun With Perl: Perl Quizzes - Learn Perl the Fun Way:
Need help on Running perl prg. thru cron


Dec 1, 2000, 8:25 PM

Views: 56744
Need help on Running perl prg. thru cron

I am in desparate need of help on the execution of perl program thru cron jobs.

I have following in my cron file:
02 12 * * * /usr/bin/perl /home/user/cgi-bin/dojobs.pl

Which i want to run everyday. But when i test this program does not execuets ... I checked the var/log/spool to see whether it had executed or not .... I see there is entry at this time for CMD execution at given time. But no result since prg. was suppose to create a log report firlwhich is not there.

Please show me how to run perl program thru cron jobs.

Any help appreciated.


Dec 1, 2000, 9:30 PM

Views: 56744
Re: Need help on Running perl prg. thru cron

I have had the same problem, according to

My code was correct, and it was running, but my script was also not making a log file that I had it do just to check if it really was working, a month passed and after yelling at my server admin because they didn't think I was right, I found out that there were over 800 emails sitting in the POP account for out server account, in each mail contained the output of the file for that day it ran, so I have no idea how cron is supposed to run a program, but obviously not the same way a browser does, I would try to make sure that the program can do everything you need it to do, by Console only, but I really don't know, I just wanted you see check that url if it helps.



Dec 7, 2000, 11:19 PM

Views: 56744
Re: Need help on Running perl prg. thru cron

try putting /bin/echo "coool" >/tmp/mycronloot

into cron to make sure that your crontab is running the way that you expect.

also crontab runs under its own environment, so if you are expecting anything to be in that, then you might be disappointed


Dec 8, 2000, 4:07 AM

Views: 56744
Re: Need help on Running perl prg. thru cron

I also had some problems running perl via cron, and the only thing I've found is that I had to put complete pathnames to all files the program uses because, as was said in an earlier post, it runs in a different environment than the one cgi's execute in.

Carpe Brie'm!
~ Seize the Cheese ~