Automatic FTP retry?

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Jeremy C. Reed
Date:  
Subject: Automatic FTP retry?
On 30 Jun 2003, Bryce C wrote:

> The most simple would be an infinite loop.
> while(true) do wget ftp://ftp.domain.com/pub/iso/thisfile.iso; done
> I'm not positive on syntax but try it.


Instead of repeating forever, just repeat while false. I assume wget
returns a non-zero return code when download was unsuccessful.

while ! wget ftp://ftp.domain.com/pub/iso/thisfile.iso ; do
echo trying again ; done

But this won't help with continue with retry (as continuing from same
part so not having to start new).

Maybe add the -c switch for wget. (Read the man page about that.)

The lukemftp (aka tnftp) client has a -r switch (followed by seconds) to
retry connection if failed. (I haven't tried if that also helps with
retrying the download.)

The wget man page says: " if a download fails due to a network problem, it
will keep retrying until the whole file has been retrieved."

wget also has a -t (--tries) option for choosing number of retries.
Also read about --waitretry.

> On Mon, 2003-06-30 at 21:25, Alan Dayley wrote:
> > Is there an FTP client, or script, that will keep trying to connect to
> > an FTP server and download a specific file?


Jeremy C. Reed
http://www.reedmedia.net/