Skip to content

Indexing

squirrel index walks a config-declared volume, hashes regular files, and updates the index.

Terminal window
squirrel index pictures

Indexing takes exactly one positional argument — a volume name declared in config. Indexing by raw path is not supported.

Re-running squirrel index updates the index incrementally:

  • new files are added,
  • modified files are re-hashed,
  • files no longer on disk are flagged as missing — rows are not deleted.

When content at a path changes, the prior row is flipped to superseded and a new row inserted; the old hash is never rewritten in place. This is the core principle in action.

Symlinks are skipped.

FlagDefaultMeaning
--shallowoffSkip re-hash when (size, mtime) match the stored row.
--dry-runoffReport what would change without writing to the database.
--workers NNumCPU()Number of hashing workers (0 = runtime.NumCPU()).
--progress, -Pauto on a TTYShow a live, throttled progress line on stderr.

--shallow trades integrity for speed: it trusts the filesystem’s (size, mtime) rather than re-reading and re-hashing file bytes. Use it for quick re-scans of large trees; use a full index (or squirrel audit --deep) when you want to catch silent bit-rot.

--progress is auto-enabled when stdout is a TTY and off for pipes, cron, and the agent. It shows files, bytes, and rate. --progress=false forces it off. The final summary line is unchanged either way.

The index is the source of truth for every other command: