cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: bash script quitting unexpectedly after calling curl from cron job

From: Ralph Mitchell <ralphmitchell_at_gmail.com>
Date: Thu, 28 Oct 2004 01:21:23 -0500

You might try doing an environment dump at the start of the script.
Something like:

     env > /tmp/post_env

should do it. Compare that to what you get in your regular shell.
Chances are that cron is giving you just a minimal environment and you
might be relying on something that's missing. PATH, for example,
probably doesn't have much beyond /bin & /usr/bin.

Ralph Mitchell

On Wed, 27 Oct 2004 18:04:10 -0400, Bill Mercer <bmerc_at_nccer.org> wrote:
> I've got a bash script that uses curl to POST a form and save the resulting
> page as a file, then does some other stuff with the file. When I run it directly,
> it works fine. When I run it as a cron job, it runs fine right up to the moment
> the result is saved, but then just quits, and doesn't run the rest
> of the script.
>
> Curl itself is doing what it's supposed to. Whatever comes AFTER
> curl it in the script just never happens.
>
> There must be something obvious I'm just missing, but I can't figure it out.
> Any suggestions?
>
> Cheers,
>
> Bill Mercer - National Center for Construction Education and Research
> 3600 NW 43rd St
> Gainesville, Florida 32606
> http://www.nccer.org
> Phone 352-334-0911 Fax 352-334-0932
> =============================================
>
>
Received on 2004-10-28