cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Control error in curl tool

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Wed, 25 Aug 2010 17:11:42 +0200 (CEST)

On Wed, 25 Aug 2010, Xavier Fernandez wrote:

> curl -o 'destination file' -x 'Proxy address' -U 'Proxy userid/password' "
> http://www.webaddress.com/file-tobe-downloaded"

> I want send and email automatically (using for exemple blat.exe) when curl
> fails to donwload the file

curl returns a non-zero exit code that you should be able to check.

Otherwise you could possibly use -f and then count on the fact that curl won't
create any destination file if it failed. Or perhaps use -w and one of the
informationals to extract info from the download.

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ:        http://curl.haxx.se/docs/faq.html
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2010-08-25