Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

1 Answer 1

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.