Quickstart
This is a ~60-second round-trip with no cloud account and no setup: snapshot a
directory, push it to a local store, pull it back somewhere else, and confirm
it is byte-for-byte identical. The only thing you need is the snapdir binary —
see Install if you don't have it yet.
A snapshot is identified by the BLAKE3 hash of its manifest, so identical content always produces the same snapshot ID on any machine. Every object is re-hashed and verified on fetch, so a successful pull is a proof of integrity.
1. Create a directory and read its ID
Make a directory with some content, then ask snapdir for its content-addressed ID.
Nothing is stored yet — snapdir id just hashes the directory:
mkdir -p demo && echo hello > demo/a.txt
snapdir id ./demo
The printed ID depends only on the content. Run snapdir id ./demo again (or on
another machine with the same files) and you get the exact same ID.
2. Push to a local store
A store is addressed by a URI of the form protocol://location/path. For a local
round-trip the protocol is file://, which is just a directory on disk. push
uploads the snapshot and prints its ID, so capture it in a variable:
id=$(snapdir push --store "file://$PWD/store" ./demo)
echo "$id"
That is the same ID snapdir id printed in step 1. Objects are stored at
content-addressed keys, so unchanged files are never uploaded twice.
3. Pull it back and verify
Pull the snapshot into a fresh directory. pull fetches every object from the
store, re-hashes it, and checks it out — failing loudly if anything does not match:
snapdir pull --store "file://$PWD/store" --id "$id" ./restored
snapdir id ./restored # prints the same $id — byte-for-byte identical
If snapdir id ./restored prints the same ID, the restore is verified identical to
the original. You can also explicitly check a staged snapshot with
snapdir verify.
Going further
Swap file://$PWD/store for an s3://…, gs://…, or b2://… URI and the exact
same push/pull commands publish to and restore from the cloud — no other
changes.
- Snapshotting guide — how IDs and manifests work.
- Command reference overview — every subcommand.
- Command pages:
snapdir id,snapdir push,snapdir pull.