The freezer.storage.base
Module¶
-
class
freezer.storage.base.
Backup
(engine, hostname_backup_name, level_zero_timestamp, timestamp, level, storage=None)[source]¶ Bases:
object
Internal freezer representation of backup. Includes:
name (hostname_backup_name) of backup timestamp of backup (when it was executed) level of backup (freezer supports incremental backup)
Completed full backup has level 0 and can be restored without any additional information. Levels 1, 2, ... means that our backup is incremental and contains only smart portion of information (that was actually changed since the last backup)
-
class
freezer.storage.base.
Storage
(skip_prepare=False)[source]¶ Bases:
object
Any freezer storage implementation should be inherited from this abstract class.
-
get_latest_level_zero_increments
(engine, hostname_backup_name, recent_to_date=None)[source]¶ Returns the latest zero level backup with increments :param engine: :param hostname_backup_name: :param recent_to_date: :rtype: dict[int, freezer.storage.base.Backup] :return: Dictionary[backup_level, backup]
-
get_level_zero
(engine, hostname_backup_name, recent_to_date=None)[source]¶ Gets backups by backup_name and hostname :type engine: freezer.engine.engine.BackupEngine :param hostname_backup_name: :type hostname_backup_name: str :type recent_to_date: int :param recent_to_date: :rtype: collections.Iterable[freezer.storage.base.Backup] :return: dictionary of level zero timestamps with attached storage
-
previous_backup
(engine, hostname_backup_name, no_incremental, max_level, always_level, restart_always_level)[source]¶ Parameters: - engine (freezer.engine.engine.BackupEngine) – engine instance
- hostname_backup_name – name of backup
- no_incremental –
- max_level –
- always_level –
- restart_always_level –
Returns:
-
put_metadata
(engine_metadata_path, freezer_metadata_path, backup)[source]¶ Parameters: - engine_metadata_path –
- freezer_metadata_path –
- backup (freezer.storage.base.Backup) –
Returns:
-
remove_older_than
(engine, remove_older_timestamp, hostname_backup_name)[source]¶ Removes backups which are older than or equal to the specified timestamp :type engine: freezer.engine.engine.BackupEngine :type remove_older_timestamp: int :type hostname_backup_name: str
-
type
¶
-
write_backup
(rich_queue, backup)[source]¶ Parameters: - rich_queue –
- backup (freezer.storage.base.Backup) –
Returns:
-