Skip to main content

Module ops

Module ops 

Source
Expand description

File operations: recover .bakโ†’.sav, backup/restore full, .ini management.

Backups are stored as tar.gz archives: one archive per backup event, containing all savegame_* files. .ini backups use the same format. Standard tar -xzf recovers data without the tool (no vendor lock-in).

Structsยง

BackupResult
Result of a backup operation.
BakFileSummary
Enriched .bak file entry with GVAS metadata for the picker UI.
RecoveryResult
Result of a recovery operation.

Functionsยง

backup_ini_files
check_tar_gz_integrity
Quick integrity check: verify the file is non-empty and starts with gzip magic bytes (1f 8b). Returns true if the archive looks valid.
create_full_backup
create_tar_gz ๐Ÿ”’
Create a tar.gz archive containing all files from src that match a filename predicate. Returns the path to the created archive.
dedup_by_slot
Keep only the most recent .bak per slot, discarding older versioned backups.
delete_ini_files
extract_tar_gz ๐Ÿ”’
Extract a tar.gz archive into dest. Returns the number of files extracted (excluding MANIFEST). Validates each file against the manifest SHA256 hashes if present.
folder_stats
Scan the save folder and return stats for the dashboard.
list_bak_files
List .bak files in the save folder, sorted by mtime descending.
list_bak_files_with_meta
List .bak files with parsed GVAS metadata.
list_full_backups
list_ini_backups
list_tar_gz ๐Ÿ”’
List tar.gz files in a directory, sorted by mtime descending.
migrate_backups_from ๐Ÿ”’
Migrate old directory-tree backups from a given root path. Separated from migrate_old_backups() so tests can use temp directories.
migrate_old_backups
Migrate old NotAlterra_Backups/ directory-tree backups into the new tar.gz format. Each timestamped directory becomes its own .tar.gz archive in backups/saves/. The old directory is not deleted.
recover_bak_to_sav
restore_full_backup
restore_ini_files