Resume transfers
Large downloads can be cut off by a dropped network, a lost SSH connection, or a phone putting the app in the background. ZestSSH keeps what already arrived, so the next download of the same file carries on from where it stopped instead of starting over. Uploads work differently: an interrupted upload never damages the file on the server, but it starts again from the beginning. On an FTPS host, an upload cut off by the connection carries on too: see FTPS hosts.
How a download is written
Section titled “How a download is written”ZestSSH never writes a download straight into its destination. For a file called backup.tar, it writes:
backup.tar.zestpart: the bytes as they arrive.backup.tar.zestpart.meta: a small note of which server file those bytes came from, with its size and its last change on the server.
Only when every byte is there, and the size matches, does ZestSSH put the file in its place as backup.tar and remove the note. Until then, a file already called backup.tar in that folder is left exactly as it was, through a cancel, a dropped connection or a crash. The downloaded file keeps the server copy’s last-change time.
How resuming works
Section titled “How resuming works”When you download a file to a folder that holds a .zestpart of it from an earlier try, ZestSSH checks the note first. It carries on from the end of the partial file only when all of these hold:
- the note names the same file on the server;
- the server file still has the size it had;
- the server file’s last change is the same (where both the note and the server give one);
- the partial file is not larger than the server file.
If anything does not match, or the note is missing or unreadable, ZestSSH throws the partial file away and starts the download from the beginning. A wrong resume would mix two versions of a file without a sign; a fresh start only costs time. If the partial file already holds the whole file, ZestSSH just puts it in place.
The progress shown counts the whole file, so a 100 MB file that stopped at 60 MB starts again at 60%.
How to resume
Section titled “How to resume”- On a computer: a download that failed has Retry on its row in the Activity panel, which sends it again to the same folder. For a download you canceled, download the same file to the same folder again.
- On a phone: download the same file again with Download. It goes to the same folder, so the partial file is found.
A copy between two servers goes through a new temporary folder each time, so it does not resume.
Uploads
Section titled “Uploads”An upload is written beside the file on the server, as name.zestpart, and put in the file’s place only when the server has all of it and its size matches what was sent. A canceled or failed upload removes that partial file and leaves the server’s file as it was. The next upload starts from the beginning.
There is one exception: where ZestSSH cannot make a new file beside the old one (a file owned by another group, or a folder you may not write to), it writes into the file itself. If such an upload fails, the error says that the file on the server now holds part of the new content, and to save or upload it again.
An interrupted Folder sync can simply be run again: files that were fully uploaded are recognized and skipped, so only the rest is sent.
FTPS hosts
Section titled “FTPS hosts”Transfers to and from an FTPS host go through .zestpart files too, and are put in place only when whole. They resume with a few differences:
- Downloads use the same note and the same checks as above, and carry on from where they stopped.
- Uploads resume. When the connection breaks during an upload, what the server already has stays beside the file as
name.zestpart. The next upload of the same file of this device, unchanged, to the same place within a week carries on from what the server has, even after the app restarts. A server that takes no resumed upload gets the whole file again. An upload that fails for another reason removes its partial file. - A cancel keeps nothing. A canceled download or upload removes its partial file, so the next try starts from the beginning.
- Retry on a phone too. An FTPS host’s files open in the two-pane browser on a phone as on a computer, so a failed transfer has Retry in the Activity panel there.
When the connection drops
Section titled “When the connection drops”A transfer under way when its connection drops ends and says that the connection to the server was lost. It does not wait for ever. The partial download stays for the next try, and the destination is left as it was.
Checking the result
Section titled “Checking the result”On a computer, after an upload or a download of a file between 4 MB and 256 MB, ZestSSH compares a SHA-256 checksum of both copies (sha256sum or shasum on the server) and marks the row Verified or Checksum mismatch. This happens after a resumed download too. On an FTPS host, the server works out its copy’s SHA-256 itself, which it can do only where it offers HASH with SHA-256, or XSHA256; a server with neither is not checked this way. A phone runs this check for an FTPS host’s transfers, which open in the same two-pane browser, but not in its own SFTP browser. For uploads of whole folders, Folder sync’s Verify by content compares your files with the server copies by SHA-256 checksum.
Practical use
Section titled “Practical use”Resuming is most useful for:
- Large log files or database dumps over a slow or unsteady connection.
- Disk images or firmware files, where downloading gigabytes again costs time and bandwidth.
- Downloads on a phone, where the app going to the background can end the connection. Connect again and download the file again to carry on.
Related
Section titled “Related”- SFTP browser: the SFTP screens on a phone and a computer.
- Parallel transfers: how several files move at once.