Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Sometimes, curl freezes:

$ curl -O 'http://www.site.com/index.html'

  www.site.com/index.html --> index.html
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:--  0:02:17 --:--:--     0^C

After waiting for 137", I hit Ctrl-C, and re-download.


$ curl -O 'http://www.site.com/index.html'

  www.site.com/index.html --> index.html
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 49045    0 49045    0     0   4598      0 --:--:--  0:00:10 --:--:--  6078

It just takes 10" to download.


It sounds like, curl is waiting for response for ever.
How to make curl reconnect automatically after 60"?

share|improve this question
up vote 0 down vote accepted

retry 3 times, each time 60" at most:

curl -O --retry 3 -m 60 'http://www.site.com/index.html'
share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .