Module backup

Module backup 

Expand description

Backing up unreadable journal files as .corrupt-* siblings and pruning old backups.

Structsยง

BackupId ๐Ÿ”’
Identifies a .corrupt-<millis>-<seq> backup file, ordered by creation time.

Constantsยง

MAX_BACKUPS ๐Ÿ”’
Number of .corrupt-* backups kept per journal path; older ones are deleted once a new one is created.

Functionsยง

backup_and_reset ๐Ÿ”’
Renames path aside as a timestamped backup and returns an empty session.
prune_old_backups ๐Ÿ”’
Deletes .corrupt-* backups for path beyond the MAX_BACKUPS most recent, so a repeatedly-failing journal doesnโ€™t accumulate backups forever.