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 / Arg | Type | Default | Description |
|---|---|---|---|
--json | boolean | false | Print the outcome as JSON |
--local | boolean | false | Local-only VACUUM INTO backup (no compression or encryption) |
Subcommands
| Command | Description |
|---|---|
init | Set up encrypted state backup: install LFS, create recipients, verify round-trip |
status | Show 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.