backup
Read backup destinations, schedules and runs, prove archives by restoring them, and download them.
Backups are written by schedules to destinations, one archive per run. A backup nobody has restored is unproven, so backup ls shows when each schedule was last read back beside when it was last written. Schedules, runs and drills have no names; they are given by id. Every command also takes --json, --quiet and --help.
| Command | What it does |
|---|---|
stechbd backup destination:ls | The buckets backups can be written to, and whether each has been proved |
stechbd backup ls | Every schedule, when it last backed up and when an archive was last restored |
stechbd backup runs | A schedule's runs, their state and size |
stechbd backup run | Back up now, outside the schedule |
stechbd backup drills | The restores a schedule has run against its archives |
stechbd backup drill | Restore an archive to prove it can be read, into a scratch database unless --in-place |
stechbd backup download | Print a short-lived URL for one archive |
stechbd backup destination:ls
Lists the destinations, the storage buckets that backups can be written to. Each one shows whether it has been proved, which means an archive was written to it and read back.
stechbd backup destination:lsstechbd backup destination:ls --jsonstechbd backup ls
Lists every schedule with when its archives were last written and when they were last restored. A schedule that has never been restored is flagged below the table, with the command to prove it.
stechbd backup lsstechbd backup ls --jsonstechbd backup runs
Lists the runs of one schedule, with each run's state and size. Use a run's id with backup drill or backup download.
stechbd backup runs <schedule>| Option | Description |
|---|---|
<schedule> | The schedule, by id. Required. |
stechbd backup runs 01J...stechbd backup run
Starts a backup of one schedule now, outside its timing. The command prints the new run and its state, and does not wait for the backup to finish.
stechbd backup run <schedule>| Option | Description |
|---|---|
<schedule> | The schedule, by id. Required. |
stechbd backup run 01J...stechbd backup drills
Lists the restore drills run against the archives of one schedule, so you can check which archives have been restored and how each attempt ended.
stechbd backup drills <schedule>| Option | Description |
|---|---|
<schedule> | The schedule, by id. Required. |
stechbd backup drills 01J...stechbd backup drill
Restores one archive to prove it can be read. By default the restore goes into a scratch database and touches nothing live. With --in-place the restore overwrites the live database with the archive instead, so it is a restore and not a test. That form asks first, and says what it replaces.
stechbd backup drill <run> [--in-place] [--yes]| Option | Description |
|---|---|
<run> | The run whose archive is restored, by id. Required. |
--in-place | Restore over the live database instead of a scratch one. |
--yes | Skip the question that --in-place asks. Required outside a terminal. |
stechbd backup drill 01J...
stechbd backup drill 01J... --in-place --yesstechbd backup download
Prints a short-lived URL for one archive. The URL goes to stdout alone, so it can be passed to curl -o. The time it stays valid is written to stderr.
stechbd backup download <run>| Option | Description |
|---|---|
<run> | The run whose archive to download, by id. Required. |
curl -o archive.dump "$(stechbd backup download 01J...)"