Volumes & files

Volumes, files and snapshots

Attach persistent volumes, work with the files on them, and snapshot them.

stackblaze volume

Alias: volumes

Extra persistent volumes mounted into the linked app. add attaches a new volume at an absolute mount path; names are lowercase letters, digits and dashes. delete detaches one and asks you to type its name unless -y.

usage
stackblaze volume [list]
stackblaze volume add <name> --mount <path> [--size <qty>]
stackblaze volume delete <name> [-y]
FlagDescription
--mount <path>add: mount path inside the app (required)
--size <qty>add: size (default 5Gi)
--name <name>add: same as the positional name
-y, --yesdelete: skip the confirmation

Also accepts the scope flags (-p, --project, -e, --env, -a, --app) and the output flags (-o, --output, --json), plus --token, --api-url and --org. Common flags

Examples

terminal
stackblaze volume add data --mount /data --size 10Gi
stackblaze volume delete data -y

stackblaze files

Works with files on the app's volume mounts through a running instance. File access comes with Console, which must be enabled for your organization (Platform → Console & SSH). mounts lists the paths you can use; download writes a tar archive; upload copies a local file, and extracts a tar archive when --path ends in / or with --extract (automatic for .tar and .tgz).

usage
stackblaze files mounts
stackblaze files list --path <dir>
stackblaze files download [path] [--out <file>]
stackblaze files upload <local> --path <path> [--extract]
stackblaze files rename --from <path> --to <path>
stackblaze files delete [path] [-y]
FlagDescription
--path <path>Absolute path under a mount, e.g. /data (list, download and delete also take it as [path])
--out <file>download: local file to write (default <basename>.tar; -o <file> also works)
--extractupload: extract a tar archive at --path
--from <path>, --to <path>rename: source and destination
--pod <name>Instance to use (default: the app's main instance)
--container <name>web (default) or worker
-y, --yesdelete: skip the confirmation

Also accepts the scope flags (-p, --project, -e, --env, -a, --app) and the output flags (-o, --output, --json), plus --token, --api-url and --org. Common flags

Examples

terminal
stackblaze files mounts
stackblaze files list --path /data
stackblaze files download /data/uploads --out uploads.tar
stackblaze files upload ./seed.tgz --path /data/

stackblaze snapshots

Alias: snapshot

create snapshots every volume of the app as one group. restore restores a whole group, or one volume from one snapshot, asks for confirmation unless -y, and waits for the outcome unless -d.

usage
stackblaze snapshots list
stackblaze snapshots create [--group-id <id>]
stackblaze snapshots restore --group-id <id> [-y] [-d] [--timeout <seconds>]
stackblaze snapshots restore --pvc-name <name> --snapshot-name <name> [-y] [-d] [--timeout <seconds>]
FlagDescription
--group-id <id>create: group ID to use; restore: the group to restore
--pvc-name <name>restore: the volume to restore (single-volume restore)
--snapshot-name <name>restore: the snapshot to restore it from
-y, --yesrestore: skip the confirmation
-d, --detachrestore: return once the restore has started
--timeout <seconds>restore: maximum wait for the restore to finish (default 600)

Also accepts the scope flags (-p, --project, -e, --env, -a, --app) and the output flags (-o, --output, --json), plus --token, --api-url and --org. Common flags

Examples

terminal
stackblaze snapshots create --group-id before-migration
stackblaze snapshots restore --group-id before-migration -y