S Technologies's Logo

Color

Green
Teal
Indigo
Blue
Purple
Red
Rose

Mode

Light

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.

CommandWhat it does
stechbd backup destination:lsThe buckets backups can be written to, and whether each has been proved
stechbd backup lsEvery schedule, when it last backed up and when an archive was last restored
stechbd backup runsA schedule's runs, their state and size
stechbd backup runBack up now, outside the schedule
stechbd backup drillsThe restores a schedule has run against its archives
stechbd backup drillRestore an archive to prove it can be read, into a scratch database unless --in-place
stechbd backup downloadPrint 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.

bash
stechbd backup destination:ls
bash
stechbd backup destination:ls --json

stechbd 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.

bash
stechbd backup ls
bash
stechbd backup ls --json

stechbd 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.

bash
stechbd backup runs <schedule>
OptionDescription
<schedule>The schedule, by id. Required.
bash
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.

bash
stechbd backup run <schedule>
OptionDescription
<schedule>The schedule, by id. Required.
bash
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.

bash
stechbd backup drills <schedule>
OptionDescription
<schedule>The schedule, by id. Required.
bash
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.

bash
stechbd backup drill <run> [--in-place] [--yes]
OptionDescription
<run>The run whose archive is restored, by id. Required.
--in-placeRestore over the live database instead of a scratch one.
--yesSkip the question that --in-place asks. Required outside a terminal.
bash
stechbd backup drill 01J...
stechbd backup drill 01J... --in-place --yes

stechbd 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.

bash
stechbd backup download <run>
OptionDescription
<run>The run whose archive to download, by id. Required.
bash
curl -o archive.dump "$(stechbd backup download 01J...)"