stouputils.backup.consolidate module#

consolidate_backups(
zip_path: str,
destination_zip: str,
) None[source]#

Consolidates the files from the given backup and all previous ones into a new ZIP file, ensuring that the most recent version of each file is kept and deleted files are not restored.

Parameters:
  • zip_path (str) – Path to the latest backup ZIP file (If endswith “/latest.zip” or “/”, the latest backup will be used)

  • destination_zip (str) – Path to the destination ZIP file where the consolidated backup will be saved

Examples:

> consolidate_backups("/path/to/backups/latest.zip", "/path/to/consolidated.zip")
[INFO HH:MM:SS] Consolidating backups
[INFO HH:MM:SS] Consolidated backup created: '/path/to/consolidated.zip'