Skip to main content
Save a snapshot when you want to return to a sandbox’s current state. It includes files, memory, and running processes. Use a fork when you want another working copy immediately.

Save and restore

Create a sandbox, write a file, and save a durable checkpoint:
The original sandbox keeps running. wait_durable=True waits until the snapshot has finished saving and can be used if the original sandbox becomes unavailable. Restore that snapshot into a new sandbox:
The restored sandbox has its own ID and uses the snapshot’s CPU and memory configuration. You cannot change that configuration during restore. Changes made after the snapshot are not included, and changes to the restored copy do not change the original.

Check an existing snapshot

You can create a snapshot without waiting for durability, then check it later:
A snapshot may be restorable before it is durable. Wait for durability before deleting the original sandbox or relying on the checkpoint for recovery. If a wait times out, check the snapshot again; the wait ending does not cancel saving. Find snapshots in Console → Snapshots or with box.snapshots.list(). To save a checkpoint and let the original sandbox rest immediately, use snapshot(leave_paused=True, wait_durable=True). Its next command or file access wakes it automatically; it does not require resume().

Fork for parallel work

Create an independent copy of the current sandbox:
The original still contains First result. To create several copies from the same point, request them together:
fork() returns one sandbox. Passing n returns a list, including when n=1. You can create up to four copies per call, within your organization’s sandbox limit. Fork between commands whenever possible. Copies inherit running processes and connection state, so reconnect external services separately in each copy before using them. Avoid copying a process that is partway through an external write.

Clean up

Snapshots remain after you delete their original sandbox. Delete each resource when you no longer need it:
To download a snapshot’s files outside LithosBox, see Snapshots and exports.