Skip to Content
CLI & APICommand reference

stackblaze snapshots

Volume snapshots

Usage: stackblaze snapshots|snapshot [options] [command]

Volume snapshots

Options:
  -h, --help                            Print help

Commands:
  list [options]                        List volume snapshots for an app
  create [options]                      Snapshot all app volumes
  clone [options] <group-id> <new-app>  Restore a snapshot group as a NEW app
                                        (its volumes made from the snapshots;
                                        nothing running is touched)
  delete|rm [options] <snapshot>        Delete one volume snapshot (the volume
                                        is not touched; confirm by typing its
                                        name)
  help [command]                        Print this message or the help of the
                                        given subcommand(s)

snapshots list

Usage: stackblaze snapshots list [options]

List volume snapshots for an app

Options:
  --api-url <url>        StackBlaze API base URL (env STACKBLAZE_API_URL)
  --token <token>        API token, sb_pat_... (env STACKBLAZE_TOKEN)
  -p, --project <name>   Project name
  -e, --env <name>       Environment name (default: production)
  -a, --app <name>       App name
  --json                 Output JSON (same as -o json) (default: false)
  -o, --output <format>  Output format: text or json (choices: "text", "json")
  -h, --help             Print help

Example

List an app's volumes and their snapshots. A snapshot can be cloned once it shows ready=true.

stackblaze snapshots list -p github-demo-cw8z -e stage -a vite-starter
data  1Gi
  vite-starter-5tjx-data-1795619211011  group=snap-vite-starter-5tjx-1795619210271  ready=true
Restore = a NEW copy, never in place: `stackblaze snapshots clone <group> <new-app>`, or `stackblaze backups restore <id> [--volume <name>]` (recovery points)

snapshots create

Usage: stackblaze snapshots create [options]

Snapshot all app volumes

Options:
  --api-url <url>        StackBlaze API base URL (env STACKBLAZE_API_URL)
  --token <token>        API token, sb_pat_... (env STACKBLAZE_TOKEN)
  -p, --project <name>   Project name
  -e, --env <name>       Environment name (default: production)
  -a, --app <name>       App name
  --json                 Output JSON (same as -o json) (default: false)
  --group-id <id>        Custom snapshot group ID
  -o, --output <format>  Output format: text or json (choices: "text", "json")
  -h, --help             Print help

May be disabled by your platform admin.

Example

Snapshot every volume of an app at once. The snapshots share one group ID, which snapshots clone restores from.

stackblaze snapshots create -p github-demo-cw8z -e stage -a vite-starter
OK Snapshot group snap-vite-starter-5tjx-1795619210271
1 volume(s) snapshotted

snapshots clone

Usage: stackblaze snapshots clone [options] <group-id> <new-app>

Restore a snapshot group as a NEW app (its volumes made from the snapshots;
nothing running is touched)

Options:
  --api-url <url>        StackBlaze API base URL (env STACKBLAZE_API_URL)
  --token <token>        API token, sb_pat_... (env STACKBLAZE_TOKEN)
  -p, --project <name>   Project name
  -e, --env <name>       Environment name (default: production)
  -a, --app <name>       App name
  --json                 Output JSON (same as -o json) (default: false)
  --wait                 Follow the clone until it is ready (default: false)
  --timeout <seconds>    Max --wait time (default 1800)
  -o, --output <format>  Output format: text or json (choices: "text", "json")
  -h, --help             Print help

Example

Restore a snapshot group as a new app, vite-starter-restore, with volumes made from the snapshots. The original app isn't touched. --wait follows the copy until it is done; the new app then builds and starts on its own (stackblaze wait follows that). Afterwards the new app has the file that was on the volume when the snapshot was taken.

stackblaze snapshots clone snap-vite-starter-5tjx-1795619210271 vite-starter-restore --wait -p github-demo-cw8z -e stage -a vite-starter
stackblaze ssh -p github-demo-cw8z -e stage -a vite-starter-restore --command 'cat /data/orders.txt'
OK Cloned vite-starter-5tjx into new app vite-starter-restore-0g7r
order 1001

snapshots delete

Usage: stackblaze snapshots delete|rm [options] <snapshot>

Delete one volume snapshot (the volume is not touched; confirm by typing its
name)

Options:
  --api-url <url>        StackBlaze API base URL (env STACKBLAZE_API_URL)
  --token <token>        API token, sb_pat_... (env STACKBLAZE_TOKEN)
  -p, --project <name>   Project name
  -e, --env <name>       Environment name (default: production)
  -a, --app <name>       App name
  --json                 Output JSON (same as -o json) (default: false)
  --pvc-name <name>      The volume, when several have a snapshot of that name
  -y, --yes              Skip the confirmation prompt (default: false)
  -o, --output <format>  Output format: text or json (choices: "text", "json")
  -h, --help             Print help

Example

Delete one snapshot (a name from snapshots list). Type the snapshot name to confirm, or pass -y. The volume itself stays as it is.

stackblaze snapshots delete vite-starter-5tjx-data-1795619211011 -p github-demo-cw8z -e stage -a vite-starter
stackblaze snapshots list -p github-demo-cw8z -e stage -a vite-starter
!  This deletes snapshot vite-starter-5tjx-data-1795619211011 of volume data (github-demo-cw8z/stage/vite-starter-5tjx). The volume itself is not touched.
Type the snapshot name to confirm: vite-starter-5tjx-data-1795619211011
OK Deleted snapshot vite-starter-5tjx-data-1795619211011 (data)
data  1Gi

On this page