Prevent FTP transfer from failing when FTP server is restarted

0

When downloading large files (ca. 5GB) with the lftp client, I find that a restart of the FTP service (vsftpd) stops the transfer and I have to restart it from the beginning. Is there a way to prevent the transfer from failing when the FTP server is restarted?

Jagadeesh Varma

Posted 2013-07-17T17:55:42.903

Reputation: 1

2Not restarting the FTP server isn't an option? – Daniel Beck – 2013-07-17T17:58:43.440

Expecting a restart of the FTP server not to kill the transfer is expecting too much; I'd suggest that the problem here is that the FTP server gets restarted too often, and that it'd be more worth your time to look for either a way to prevent that from happening, or an alternate file transfer mechanism that's more resilient than FTP. (For example, if the files are also available via HTTP from a service supporting the Range header, you can use a client such as wget which supports restarting partially completed downloads.) – Aaron Miller – 2013-07-17T18:09:23.483

Answers

2

It's not possible as terminating the vsftpd service will also terminate any network connections it has. Even if you could force the client to ignore this, the newly restarted service isn't going to know what to do with fragments of an FTP transfer in progress from a client that hasn't previously logged in to it.

FTP has a facility for resuming interrupted downloads, and vsftpd does support resuming if configured correctly. Looks like the pget -c option in lftp also supports resuming a client transfer.

LawrenceC

Posted 2013-07-17T17:55:42.903

Reputation: 63 487