Backup Module

pybacked.backup.backup(config)

Perform a backup with the given configuration

Parameters

config (Configuration) – The configuration for the backup. All the needed data should be stored inside a Configuration class object.

pybacked.backup.create_filedict(diffcache, subdir='')

Create a dictionary of filepath, filename key-value pairs for each enty (and subdirectory-entry) in the DiffCache. Here the filename refers to the name that the file is given in the archive and is derived from the basename of the path.

Parameters
  • diffcache (DiffCache) – The DiffCache from which the dictionary should be created.

  • subdir (str) – A subdirectory prefix, which will be prepended to the filenames. This is mainly used for recursion.

Returns

Returns a dictionary of filepath, filename key-value pairs which, can be passed to zip_handler.archive_write().

Return type

dict

pybacked.backup.get_new_archive_name(archive_dir)

Checks for existing archives and returns the name of the next archive to be created.

Parameters

archive_dir (str) – The directory in which the archives are located

Returns

Returns the name, that the next archive should have

Return type

str