freezer.engine.rsyncv2.rsyncv2 module

Freezer rsync incremental engine

class freezer.engine.rsyncv2.rsyncv2.Rsyncv2Engine(**kwargs)

Bases: freezer.engine.engine.BackupEngine

backup_data(backup_path, manifest_path)

Execute backup using rsync algorithm.

If an existing rsync meta data for file is available - the backup will be incremental, otherwise will be executed a level 0 backup.

Parameters
  • backup_path – Path to backup

  • manifest_path – Path to backup metadata

get_fs_meta_struct(fs_meta_path)
get_sign_delta(fs_path, manifest_path, write_queue)

Compute the file or fs tree path signatures.

Return blocks of changed data.

Parameters
  • fs_path

  • manifest_path

  • write_queue

Returns

metadata(*args)
property name
Return type

str

Returns

Engine name

restore_level(restore_path, read_pipe, backup, except_queue)

Restore the provided backup into restore_abs_path.

Decrypt backup content if encrypted. Freezer rsync header data structure:

[ {
    'path': '' (path to file),
    'inode': {
        'mode': st_mode,
        'dev': st_dev,
        'uname': username,
        'gname': groupname,
        'atime': st_atime,
        'mtime': st_mtime,
        'size': st_size
    } (optional if file removed),
   'lname': 'link_name' (optional if symlink),
   'prev_name': '' (optional if renamed),
   'new_level': True (optional if incremental),
   'deleted': True (optional if removed),
   'deltas': len_of_blocks, [modified blocks] (if patch)
  },
  ...
]
Parameters
  • restore_path – Path where to restore file(s)

  • read_pipe – ackup data

  • backup – Backup info

  • except_queue – Queue for exceptions

write_engine_meta(manifest_path, files_meta)