Here’s a little terminal command I use to repeatedly attempt to download a file. This is useful if the transfer aborts frequently or if the server is busy:
As you can see I used this to download Parallels VM, because their servers keep dropping the connection after a while when they’re busy, which often happens when a new release comes out.
The while/do/done loop keeps calling curl, with pauses of 10 seconds. curl will keep returning a failure exit code, which is what keeps the while loop going if inverted with the ! (logical not) operator. The -C - flag tells curl to continue at the last byte position.
ha ha,
(so you are the one who is keeping the server busy! ;)
thnx for the tip.
stuff like this makes me glad to have a mac.. on pc I had to write a vb program to do this..
Trackback URL for this entry: http://www.entropy.ch/blog/Mac+OS+X/2007/02/28/Terminal-Tricks-Download-with-cURL-in-a-Loop-Until-Completed.html?tb=y
|













You can also download it from mirrors, check the forums on parallels for links. I got 700+ kb/s download from them.