LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (http://www.linuxquestions.org/questions/linux-general-1/)
-   -   simple curl syntax doubt (http://www.linuxquestions.org/questions/linux-general-1/simple-curl-syntax-doubt-738152/)

sl33p 07-06-2009 03:53 PM

simple curl syntax doubt
 
Hello LQ people,

I read about the correct way to download a file with both resuming and redirecting functions, on the Debian website: When I run the following command:

Code:

$curl -C - -L http://cdimage.debian.org/debian-cd/5.0.2/amd64/iso-dvd/debian-502-amd64-DVD-[1-5].iso -o "debian-502-amd64-DVD-#1.iso"
The download starts correctly, with the output:
Code:

[1/5]: http://cdimage.debian.org/debian-cd/5.0.2/amd64/iso-dvd/debian-502-amd64-DVD-1.iso --> debian-502-amd64-DVD-1.iso
So it works!

My doubt is only about the syntax of this command options. I mean, why the second dash following -C ?? Does it mean it should resume automatically if the download fails? I couldn't find anything related on the man page.

Thanks in advance!
sl33p

acid_kewpie 07-06-2009 04:18 PM

from the curl manpage:
Code:

      -C/--continue-at <offset>
              Continue/Resume a previous file transfer at the  given  off‐
              set. The given offset is the exact number of bytes that will
              be skipped counted from the beginning  of  the  source  file
              before  it  is transferred to the destination.  If used with
              uploads, the ftp server command SIZE will  not  be  used  by
              curl.

              Use  "-C -" to tell curl to automatically find out where/how
              to resume the transfer. It then uses the given  output/input
              files to figure that out.

              If  this  option is used several times, the last one will be
              used.



All times are GMT -5. The time now is 01:01 PM.