duplicity.backends.par2backend module

class duplicity.backends.par2backend.Par2Backend(parsed_url)[source]

Bases: Backend

This backend wrap around other backends and create Par2 recovery files before the file and the Par2 files are transfered with the wrapped backend.

If a received file is corrupt it will try to repair it on the fly.


delete given filename and its .par2 files


delete given filename_list and all .par2 files that belong to them

error_code(operation, e)[source]
get(remote_filename, local_path)[source]

transfer remote_filename and the related .par2 file into a temp-dir. remote_filename will be renamed into local_path before finishing.

If “par2 verify” detect an error transfer the Par2-volumes into the temp-dir and try to repair.


Return list of filenames (byte strings) present in backend

Files ending with “.par2” will be excluded from the list.

move(local, remote)[source]
put(local, remote)[source]
transfer(method, source_path, remote_filename)[source]

create Par2 files and transfer the given file and the Par2 files with the wrapped backend.

Par2 must run on the real filename or it would restore the temp-filename later on. So first of all create a tempdir and symlink the soure_path with remote_filename into this.