DevelopmentUnreleased

This topic is not available in this guide. You're viewing its overview.

Development documentation may include features that are not in the latest release. Read the Lawn 0.8.1 guide.

Field guide

lawn app snapshot

Save, restore, and manage app snapshots from the terminal.

Snapshot commands

Use lawn app snapshot to save an app before a change, return to an older snapshot, or make a separate copy. You can identify a snapshot by its name, full ID, or an ID prefix that matches only one snapshot.

CommandDescription
lawn app snapshot take <app>Take a snapshot
lawn app snapshot list <app>List snapshots and Live
lawn app snapshot restore <app> <snapshot>Restore a snapshot, preserving the current state first
lawn app snapshot clone <app> <snapshot> --name <name>Clone a snapshot into a new stopped app
lawn app snapshot rename <app> <snapshot> <name>Rename a snapshot
lawn app snapshot delete <app> <snapshot>Delete a snapshot

Take a snapshot

# Use the current date and time as the name
lawn app snapshot take paperless

# Choose a name
lawn app snapshot take paperless --name "Before update"

If the app is running, Lawn briefly stops it while taking the snapshot, then starts it again.

List snapshots

# Flat table with a STORAGE column
lawn app snapshot list paperless

# Branching history
lawn app snapshot list paperless --tree

# Machine-readable graph and storage values
lawn app snapshot list paperless --output json

The storage summary shows Total app + snapshots and Shared between snapshots. See Snapshots for an explanation of the numbers.

Restore a snapshot

By default, Lawn takes a Pre-Restore snapshot of the current state before restoring:

lawn app snapshot restore paperless "Before update"

To discard the current state instead:

lawn app snapshot restore paperless "Before update" --discard-live-state

This asks for confirmation. Add --force only for intentional non-interactive use.

Clone, rename, or delete a snapshot

# Clone into a separate stopped app
lawn app snapshot clone paperless "Before update" --name "Paperless Test"

# Rename a snapshot
lawn app snapshot rename paperless "Before update" "Known Good"

# Delete a snapshot
lawn app snapshot delete paperless "Known Good"

Deleting asks for confirmation. Use --force to skip it.