create tomporary files with sftp
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Duplicity |
Fix Released
|
Medium
|
Unassigned |
Bug Description
Using ubuntu lucid ppa: 0.6.13-
when a transfer with put_sftp fails in the middle of it, there's an unfinished file left on the backend (which duplicity treats as a complete one on next run). This can be avoided simply:
- upload file with a temporary filename ignored by list()
- rename the file after a successful upload
i simply accomplished this changing backends/
def put_sftp(self, source_path, remote_filename = None):
"""Use sftp to copy source_dir/filename to remote computer"""
if not remote_filename:
// changed to upload to a temp name and then finally rename
commands = ["put \"%s\" \"%s.%s.part\"" %
commandline = ("%s %s %s" % (globals.
Now the file first gets created with a '.' as a prefix and a '.part' suffix. it is ignored by the "ls -1" in list(), so duplicity does not get confused. when uploaded - at least when the connection does not drop and the PUT returns to 'sftp>' - the file gets renamed to the desired name.
same should be done for put_scp, i think.
this helps from silently corrupted incremental backup sets when connection to the backend drops in the middle of the transfer and next backup starts.
description: | updated |
Changed in duplicity: | |
importance: | Undecided → Medium |
milestone: | none → 0.6.14 |
status: | New → Fix Committed |
Changed in duplicity: | |
status: | Fix Committed → Fix Released |