cURL / Mailing Lists / curl-users / Single Mail

curl-users

cron call to curl not working

From: Kevin <kcagle_at_mac.com>
Date: Mon, 29 Oct 2001 20:34:46 -0500

Greetings!

First, let me say that I am new to cURL, Perl, and Unix...so forgive me
if I am doing something "stupid" or something only a newbie would do.
Any help would be appreciated.

I am using Mac OS X 10.1. I'm using the already-installed cURL v.7.7.2.

Here is the gist: I have written a Perl script to log on to a particular
website. The script works fine when run from a Terminal window, but will
not work when run as a cron job.

Here are the specifics: I am writing a Perl script to check the status
of a particular website. I do this by calling curl by backticks: `curl
http://www.website.com/specific-information`. I then look for particular
info on the page, to see what needs changing. This part of the script
works fine.

Then, I am logging in to a website, then changing the particular
information that was grabbed from the first page. Here I use the "-d"
option of cURL to send my username and password. I have tried both
backticks and "open" then piping in Perl:

open (CURL, "curl -v -d \"UserName=username&Password=password\" -L
\'https://www.website.com/login.html\' |");

The cron job will grab the first website just fine, and perl will do its
stuff to it, but cURL will fail to log in to the other site. Strangely,
if I add the "--stderr '-' " command, it seems to work. Is there
something I am missing/not doing correctly? Let me know if you need more
information, as I know that since I don't know much about this stuff, I
am probably leaving out some important info. : )

Thanks,

Kevin Cagle
Received on 2001-10-30