Skip to content

bhatti volume backup

Back up a persistent volume to S3-compatible storage.

bhatti volume backup <volume-name>

Compresses (zstd) the volume’s ext4 file and uploads it to the S3-compatible bucket configured on the server. Returns a backup record with an ID, size, and S3 key.

The volume does not need to be detached for this to run. However, if writes are in flight at backup time, the snapshot may be inconsistent. For a guaranteed-consistent backup, stop the sandbox first:

Terminal window
bhatti stop dev # detaches volume, flushes guest writes
bhatti volume backup workspace
bhatti start dev # resume

Requires a backup block in the server’s config.yaml. Without it, the API returns 501 with backup not configured — add backup section to config.yaml. See Configuration: backup.

Backups are stored under the per-user S3 prefix configured by the server. Restore with bhatti volume restore.

Terminal window
bhatti volume backup workspace
backup bk_a1b2c3d4 created (workspace, 5234567890 bytes)
Terminal window
# JSON for scripting (capture the ID for later restore)
backup_id=$(bhatti volume backup workspace --json | jq -r .id)
echo "backed up: $backup_id"

This command takes only global flags. See Global flags for --url, --token, --json, --timing, --data-dir.