Skip to main content

rt state backup

rt › state › backup

Write a stamped state.db backup (VACUUM INTO) and prune backups past retention

Usage

rt state backup [flags]

Arguments & flags

Flag / ArgTypeDefaultDescription
--jsonbooleanfalsePrint the outcome as JSON
--localbooleanfalseLocal-only VACUUM INTO backup (no compression or encryption)

Subcommands

CommandDescription
initSet up encrypted state backup: install LFS, create recipients, verify round-trip
statusShow state backup health: last backup time, sizes, recipients

See code: commands/state.ts › stateBackup

Examples & notes

Run rt state backup to trigger an immediate backup cycle outside the daemon's 4-hour schedule. Each source is snapshotted, compressed with zstd, encrypted with age, and placed in ~/.mattstack/user/state-backups/. The home repo's snapshot engine commits and pushes the blobs shortly after.

rt state backup # full encrypted backup
rt state backup --local # local-only VACUUM INTO, no encryption
rt state backup status # last cycle outcome per source

--local is useful for a quick pre-change snapshot when you do not need the encryption and push pipeline.

See the State backup guide for setup, restore, and the full lifecycle.