> ## Documentation Index
> Fetch the complete documentation index at: https://docs.envlink.projectinwork.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Snapshots

> Save a box's synced files when it ends and start the next one from them, so its first sync sends only what changed.

A first sync sends every chunk of your folder. For a large repository that's the slow part of a fresh box. A **snapshot** saves the synced files when a box ends, so the next box in the same project starts with them in place.

## Save one

```bash theme={null}
envctl env create linux-build --share src=. --snapshot main
```

When the box ends, whether you delete it or it times out, envlet on its node:

1. stops the box so every write is on disk;
2. packs the sealed chunks of its latest generation into segments of about 16 MB;
3. uploads them to object storage under your project's prefix, with credentials that work only for that prefix and expire in 15 minutes.

The files are never decrypted on the way: what's stored is what was already sealed under your project's key.

## Start from one

```bash theme={null}
envctl env create linux-build --share src=. --restore main
```

```text theme={null}
Starting from snapshot main (964 files, saved Oct 17 20:33); the first sync sends only what changed since.
```

The node downloads and unpacks the snapshot before the box starts, checking every chunk against your project's key, and the box lays the files out before its first sync. That sync then carries only your changes since: on the live deployment, 1 chunk and 5.7 KB instead of 18.6 MB.

`--snapshot main` on its own also restores the newest `main` when there is one. That makes it the usual flag for a box you recreate often: it saves on the way out and starts warm on the way in.

## Fallback keys

`--restore` takes a comma-separated list, tried in order. Each key matches exactly first, then as a prefix, newest first:

```bash theme={null}
envctl env create linux-build --share src=. --snapshot "feature/login" --restore "feature/login,main"
```

This starts from the branch's own snapshot when there is one, and from `main` otherwise.

## List them

```bash theme={null}
envctl snapshots
envctl snapshots --prefix feature/ --json
```

```text theme={null}
KEY                      SHARE    FILES       SIZE     SEALED SEGS  SAVED
main                     src        964    24.5 MB    18.7 MB    2  Oct 17 20:33:43
```

## What a snapshot holds

* The share synced from your machine, such as `/work` for `linux-build`, as of its last generation.
* Not the box's caches (`/cache`), and not [extra files](/guides/file-sync#extra-files), which never leave the sync.
* A snapshot is taken when a box ends, not periodically. A node that dies takes the box's unsaved changes with it.

## Delete them

Shredding the project destroys its key and its snapshot records. What's in object storage can no longer be opened by anyone:

```bash theme={null}
envctl project shred github.com/acme/app --yes
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.