SnapshotFile
Represents snapshot metadata stored in the repository.Fields
Timestamp when the snapshot was created.
Program identifier and version used to create the snapshot.
The ID of the first parent snapshot this was based on.
All parent snapshot IDs this snapshot was based on.
The tree blob ID where the snapshot contents are stored.
User-defined label for the snapshot.
List of paths contained in this snapshot.
Hostname of the device where the snapshot was created.
Username that started the backup.
User ID of the user that started the backup.
Group ID of the user that started the backup.
List of tags for categorizing the snapshot.
Original snapshot ID if this snapshot is a modified version.
Deletion protection settings.
Summary statistics about the backup operation.
User-provided description of the snapshot contents.
The unique identifier of this snapshot.
SnapshotOptions
Options for creating a new snapshot.Label for the snapshot.
Tags to add to the snapshot (can be specified multiple times).
Description of what the snapshot contains.
Read description from a file. Conflicts with
description.Set the backup time manually (e.g., “2021-01-21 14:15:23+0000”).
Mark snapshot as uneraseable. Conflicts with
delete_after.Mark snapshot to be deleted after given duration (e.g., “10d”).
Set the hostname manually.
Set the backup command manually.
DeleteOption
Options for snapshot deletion protection.NotSet
No deletion protection set.
Never
Snapshot should never be deleted (remove-protection).
After(Zoned)
Remove snapshot after the given timestamp, but prevent removing before.
SnapshotSummary
Summary information about a snapshot.New files compared to parent snapshot.
Changed files compared to parent snapshot.
Unchanged files compared to parent snapshot.
Total files processed during backup.
Total size of all processed files.
New directories compared to parent.
Changed directories compared to parent.
Unchanged directories compared to parent.
Total data blobs added by this snapshot.
Total tree blobs added by this snapshot.
Total uncompressed bytes added.
Total bytes added to repository (compressed/encrypted).
When the backup started.
When the backup finished.
Duration of backup in seconds.
Listing Snapshots
SnapshotFile::latest()
Get the latest snapshot matching a filter.SnapshotFile::from_strs()
Get snapshots from string identifiers.- Full snapshot IDs
- Short IDs (prefix matching)
"latest"for most recent snapshot"latest~N"for Nth most recent snapshot (N >= 0)
Filtering Snapshots
Snapshots can be filtered by:- Host: Filter by hostname
- Label: Filter by label
- Paths: Filter by backup paths
- Tags: Filter by tags
- Time range: Filter by creation time
SnapshotGroupCriterion to group snapshots:
Example
Snapshot Protection
Never Delete
Delete After Duration
Notes
- Snapshots are immutable once created
- Snapshot IDs are content-addressed (deterministic based on metadata)
- Parent snapshots enable incremental backups
- Tags and labels help organize and find snapshots
- Deletion protection prevents accidental data loss
- Snapshots can be compared and filtered by multiple criteria
- The
summaryfield contains detailed statistics about what was backed up