curl

Paul Howarth paul at city-fan.org
Mon Mar 7 07:15:53 UTC 2005


On Sun, 2005-03-06 at 18:06 -0800, Nifty Hat Mitch wrote:
> On Wed, Mar 02, 2005 at 12:00:52PM -0600, Aleksandar Milivojevic wrote:
> > Date: Wed, 02 Mar 2005 12:00:52 -0600
> > From: Aleksandar Milivojevic <amilivojevic at pbl.ca>
> > To: For users of Fedora Core releases <fedora-list at redhat.com>
> > Subject: Re: curl
> > Reply-To: For users of Fedora Core releases <fedora-list at redhat.com>
> > 
> > Mark Panen wrote:
> > >Hi
> > >
> > >Ok sometimes you have to be a wizard to figure out a man page.
> > >
> > >"curl ftp://ftp.someone.net/somefile.iso > somefile.iso" starts a download.
> > >
> > >What i would like to know is how to resume it ?
> > 
> > wget -c ftp://ftp.someone.net/somefile.iso
> > 
> I think paul had it. more correct.
> 
> 
>        -C/--continue-at <offset>
>               Continue/Resume a previous file transfer at the  given  offset.
>               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.
> 
> Now your line:
> 
>    curl ftp://ftp.someone.net/somefile.iso > somefile.iso
> 
> Looks like it might become:
> 
>    curl -C - ftp://ftp.someone.net/somefile.iso > somefile.iso
> 
> 
> Note the '-' after the -C

I think Aleksander was just suggesting to use wget, with its simpler
command-line interface and automatic retrying. However, until recently
wget had broken large file support and was unsuitable for downloading
DVD ISOs.

I would certainly not use:

curl -C - ftp://ftp.someone.net/somefile.iso > somefile.iso

as this would *definitely* not have the desired effect. Before even starting the curl program, the shell will overwrite the existing somefile.iso and connect standard output to a new, empty file of that name. The --output option should be used instead of a shell redirect.

Paul.
-- 
Paul Howarth <paul at city-fan.org>




More information about the users mailing list