archive

Bounded SecureTar v3 containers, shared by the server and offline recovery.

class bedrock_server_manager.backups.archive.BoundedTarInfo(name='')

Bound extended headers before tarfile allocates their metadata buffers.

name

Name of the archive member.

mode

Permission bits.

uid

User ID of the user who originally stored this member.

gid

Group ID of the user who originally stored this member.

size

Size in bytes.

mtime

Time of last modification.

chksum

Header checksum.

type

File type. type is usually one of these constants: REGTYPE, AREGTYPE, LNKTYPE, SYMTYPE, DIRTYPE, FIFOTYPE, CONTTYPE, CHRTYPE, BLKTYPE, GNUTYPE_SPARSE.

linkname

Name of the target file name, which is only present in TarInfo objects of type LNKTYPE and SYMTYPE.

uname

User name.

gname

Group name.

devmajor

Device major number.

devminor

Device minor number.

offset

The tar header starts here.

offset_data

The file’s data starts here.

pax_headers

A dictionary containing key-value pairs of an associated pax extended header.

sparse

Sparse member information.

bedrock_server_manager.backups.archive.safe_name(value: str) → str

Require portable relative paths on every supported platform.

bedrock_server_manager.backups.archive.header(path: Path) → BackupHeader

Read only the bounded public header, without trying legacy formats.

bedrock_server_manager.backups.archive.build_payload(staging: Path, target: Path, manifest: BackupManifest, compression: str = 'balanced', cancellation_event: Event | None = None, *, spool: CaptureSpool | None = None) → None

Build a portable gzip payload using a supported compression level.

bedrock_server_manager.backups.archive.write_archive(staging: Path, target: Path, manifest: BackupManifest, password: str | None, key_id: str | None, cancellation_event: Event | None = None, *, compression: str = 'balanced', prepared_payload: Path | None = None) → None

Publish a gzip payload into the existing SecureTar v3 container.

bedrock_server_manager.backups.archive.publish_archive(source: Path, destination: Path) → None

Publish an already-flushed archive and persist the directory entry.

bedrock_server_manager.backups.archive.manifest_requirements(manifest: BackupManifest) → dict[str, int]

Use the same entry/byte accounting as the portable reader.

bedrock_server_manager.backups.archive.unpack(path: Path, destination: Path, password: str | None = None, *, max_bytes: int = 1099511627776, max_files: int = 1000000, cancellation_event: Event | None = None, materialize: bool = True, stage_callback=None, read_stats=None, durable: bool = False) → BackupManifest

Authenticate the complete stream and validate inventory before using contents.