Module backup
Expand description
Backing up unreadable journal files as .corrupt-* siblings and pruning
old backups.
Structsยง
- Backup
Id ๐ - 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
pathaside as a timestamped backup and returns an empty session. - prune_
old_ ๐backups - Deletes
.corrupt-*backups forpathbeyond theMAX_BACKUPSmost recent, so a repeatedly-failing journal doesnโt accumulate backups forever.