Bug 626

Summary: sftp is unable to resume interrupted downloads/ uploads
Product: Portable OpenSSH Reporter: Hussam <hqasem>
Component: sftpAssignee: OpenSSH Bugzilla mailing list <openssh-bugs>
Status: CLOSED FIXED    
Severity: enhancement CC: cjwatson, djm
Priority: P2 Keywords: low-hanging-fruit
Version: 3.6.1p2   
Hardware: All   
OS: All   
Bug Depends on:    
Bug Blocks: 2076    
Attachments:
Description Flags
Implement truncation at "high water mark" on error none

Description Hussam 2003-08-12 14:12:37 AEST
This is not a bug, but an enhancement. I would like to see the command-line sftp
have the ability to resume interrupted downloads/ uploads.

If there's a reason why sftp-resume will not be implemented, a FAQ entry would
be appreciated.
Comment 1 Damien Miller 2003-08-25 10:28:31 AEST
resume would be a nice feature for sftp and the protocol generally supports it.
It just takes someone to write the code and make a patch (I don't have time).

There may be some subtlety if the server reorders the blocks it has sent back to
the client when the original transfer was aborted. E.g. the client requests 5
contiguous blocks of 64k from the start of the file and the server sends back
blocks 1, 2, and 5. If the client wrote block 5 to disk, the the file would
appear to be the full length but wouldn't contain all the data.

We would need to modify the download and upload routines to ftruncate() at the
highest contiguous point transferred. This should probably be done anyway...
Comment 2 Damien Miller 2005-04-21 16:33:15 AEST
Created attachment 889 [details]
Implement truncation at "high water mark" on error

This patch does the clean truncation part. It is only useful for downloads.
Comment 3 Colin Watson 2013-09-15 08:22:41 AEST
Isn't this fixed in 6.3?

 * sftp(1): add support for resuming partial downloads using the "reget"
   command and on the sftp commandline or on the "get" commandline using
   the "-a" (append) option.
Comment 4 Damien Miller 2015-11-13 14:20:22 AEDT
Yes, resumption is implemented for both get and put now.
Comment 5 Damien Miller 2016-08-02 10:40:40 AEST
Close all resolved bugs after 7.3p1 release