Globalz
Globalz

Reputation: 4604

Suspending a curl command in bash that is downloading a file

I have a large file that I am downloading using curl:

curl -s https://raw.github.... | bash

If I suspend this job with ctrl+z, and then resume it again with say fg %1 will that file still download correctly?

Thanks, Ben

Upvotes: 0

Views: 665

Answers (2)

fge
fge

Reputation: 121710

It will, as long as the socket hasn't timed out!

Upvotes: 0

kev
kev

Reputation: 161674

wget background&&continue downloading maybe help.
But it also depends on the webserver's functionality. Some of them don't allow range downloading.

$ wget -b -c http://www.website.com/download/hello.txt
   -b
   --background
       Go to background immediately after startup.  If no output file is specified via the -o, output is redirected to wget-log.
   -c
   --continue
       Continue getting a partially-downloaded file.  This is useful when you want to finish up a download started by a previous instance of Wget, or by
       another program.

Upvotes: 2

Related Questions