History
snapdir records where snapshots have been written and how they relate, building a lightweight history you can query without opening any store by hand. Three commands cover the common questions:
-
snapdir locations— where have snapshots been recorded? (which directories and stores) -
snapdir revisions— which snapshots exist at a given location? -
snapdir ancestors— how did we get here? (a snapshot's ancestor IDs and their locations)
These read snapdir's catalog of recorded activity, so they answer questions about snapshots you have created, pushed, fetched, or pulled.
List where snapshots live with snapdir locations
snapdir locations lists the directories and stores where snapshots have been
recorded — your inventory of every place snapdir knows about:
snapdir locations
Use it to discover the --store URIs and paths you can then drill into with
revisions. See snapdir locations.
List the snapshots at a location with snapdir revisions
snapdir revisions lists the snapshot IDs created on a single location — a store
URI or an absolute path. Point it at one of the locations from the previous
command:
snapdir revisions --location s3://my-bucket/snapshots
This is the catalog of IDs you can hand to snapdir pull,
snapdir fetch, or
snapdir checkout. See
snapdir revisions.
Trace lineage with snapdir ancestors
snapdir ancestors lists a snapshot's ancestor IDs together with the locations
that hold them. It answers "what came before this snapshot, and where can I get
it?" — useful for auditing provenance or finding a known-good earlier state to
restore:
snapdir ancestors --id "$id"
Combine it with revisions and locations to navigate from "I have this ID" to
"here is its lineage and exactly which store still has each ancestor." See
snapdir ancestors.
A typical investigation
# 1. Where has snapdir recorded snapshots?
snapdir locations
# 2. Which snapshot IDs exist at one of those locations?
snapdir revisions --location s3://my-bucket/snapshots
# 3. Trace one snapshot's lineage and where its ancestors live.
snapdir ancestors --id "$id"
# 4. Restore the one you want.
snapdir pull --store s3://my-bucket/snapshots --id "$id" ./restored
Where to go next
- Pushing and pulling — act on the IDs you discover here.
- Stores — the locations these commands enumerate.
- Syncing — replicate a discovered snapshot between stores.
- Reference:
snapdir locations,snapdir revisions,snapdir ancestors.