title: How to resume interrupted download automatically in curl?
body: <p>I'm working with <code>curl</code> in Linux. I'm downloading a part of a file in ftp server (using the <code>-r</code> option), but my connection is not good, it always interrupts. I want to write a script which resume download when I'm connected again.</p>
  
  <p>I've used this command, but it's not working: </p>
  
  <pre><code>until curl -r 666-9999 -C - --retry 999 -o "path/to/file" "ftp:/path/to/remote/file"; do :; done
  </code></pre>