Thread: CGI Problem

    #1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2000
    Posts
    2
    Rep Power
    0
    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.

    Thanks
    Ron
  2. #2
  3. No Profile Picture
    Gödelian monster
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Jul 1999
    Location
    Central Florida, USA
    Posts
    2,307
    Rep Power
    61
    Use cron to run Lynx or wget, calling the script using web protocol.
  4. #3
  5. No Profile Picture
    freebsd
    Guest
    Devshed Newbie (0 - 499 posts)
    >>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.
  6. #4
  7. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2000
    Posts
    2
    Rep Power
    0
    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 rdowell@ky-net.com
  8. #5
  9. No Profile Picture
    freebsd
    Guest
    Devshed Newbie (0 - 499 posts)
    No thanks.
  10. #6
  11. No Profile Picture
    Gödelian monster
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Jul 1999
    Location
    Central Florida, USA
    Posts
    2,307
    Rep Power
    61
    >>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?

IMN logo majestic logo threadwatch logo seochat tools logo