September 9th, 2000, 05:02 PM
I am running Apache on FreeBSD. I have a CGI script that works properly when run from a browser but fails when run from Cron.
It is retrieving information from web pages so I guess that when run from cron it needs to act like a browser.
Does anyone know how I can get this done.
September 10th, 2000, 12:53 AM
Use cron to run Lynx or wget, calling the script using web protocol.
September 10th, 2000, 05:30 AM
>>but fails when run from Cron
You mean from command line? If not, why didn't you test it before running it from cron?
>>so I guess that when run from cron it needs to act like a browser
Not necessary. Anyway you need to show us your code.
September 10th, 2000, 08:53 AM
rycamor - What is calling the script using web protocol?
Freebsd - Yes from the command line. I cant post the code but would be gald to email you a copy. Contact me at firstname.lastname@example.org
September 10th, 2000, 01:40 PM
September 11th, 2000, 11:27 AM
>>rycamor - What is calling the script using web protocol?
Using wget, Lynx or some command-line web tool, and calling the script with http://thehostname/thescript.cgi
But freebsd is right, even though the script is retrieving web page data, there is no reason for your script not to work from cron or the command line, unless it is set up to require http POST or GET variables, or HTTP_REFERER or some other such http variable. What language is the script written in? What error message do you get?