snapdir size
Report the logical and physical (deduplicated) byte size of a snapshot, a whole store, or a local directory.
size is MANIFEST-BASED: it reads manifests only — never the content objects
they reference — so it is O(snapshots), not O(objects), and behaves the same
against a local directory or a remote store. Because objects are stored
uncompressed, the physical figure equals the real on-disk .objects/ byte count
for everything the manifests reference.
Two figures
logical == physical when nothing is shared; logical > physical shows how much
duplication content-addressing collapsed. files counts file entries; objects
counts unique checksums.
Usage
snapdir size [OPTIONS] [PATH]
size has three modes:
Arguments
Options
The universal output flags (-q/--quiet, --color, --no-progress,
--verbose, -h, -V) are also accepted.
Output
Human-readable, for a single snapshot or a directory:
$ snapdir size ./project
logical 52 B (4 files)
physical 52 B (4 objects, deduplicated)
Whole store — a leading snapshots line is added and objects are deduplicated
across every snapshot, so logical can be much larger than physical:
$ snapdir size --store s3://backups/prod
snapshots 37
logical 45 GB (58214 files)
physical 9.8 GB (12004 objects, deduplicated)
With --json (compact, one object per line). The snapshots key is present
only for a whole-store sweep:
$ snapdir size --store s3://backups/prod --id 1220abc... --json
{"files":12345,"objects":9001,"logical_bytes":1288490188,"physical_bytes":882900992}
$ snapdir size --store s3://backups/prod --json
{"snapshots":37,"files":58214,"objects":12004,"logical_bytes":48318382080,"physical_bytes":10522669056}
Byte sizes are formatted base-1024 with B/KB/MB/GB/TB/PB units; the
--json *_bytes fields are always exact integers.
Examples
Size a working directory before pushing it:
snapdir size ./release-artifacts
Size one snapshot in a store by ID:
snapdir size --store gs://inventory/dr --id 1220def...
Size a whole store and see how much dedup saved across every snapshot:
snapdir size --store s3://backups/prod
Feed the exact figures to tooling — e.g. bytes reclaimed by deduplication:
snapdir size --store file:///srv/store --json | jq '.logical_bytes - .physical_bytes'
See also
snapdir manifest— the manifestsizereadssnapdir id— the local-directory manifest id thatsnapdir size <dir>mirrorssnapdir diff— manifest-only comparison, same read-only model