snapdir stage

Save a snapshot of a directory into the local cache.

Staging walks the directory, writes its objects into the content-addressed cache, and records the resulting manifest so it can be verified, checked out, or pushed to a store later. See Stores and cache.

Usage

snapdir stage [OPTIONS] [DIR]

Arguments

Argument Description
[DIR] Directory to stage.

Options

Option Description
--exclude <PATTERN> Exclude paths matching PATTERN.
--walk-jobs <N> Max parallel file-hashing jobs during the directory walk. Env: SNAPDIR_WALK_JOBS.
--store <URI> Store URI used by the transfer/catalog surface. Env: SNAPDIR_STORE.
--objects-store <URI> Shared object-pool store URI. Env: SNAPDIR_OBJECTS_STORE.
--cache-dir <DIR> Directory where the object cache is stored. Env: SNAPDIR_CACHE_DIR.
--catalog <NAME> Catalog adapter to record this snapshot's location in. Env: SNAPDIR_CATALOG; unset uses the default catalog, none disables catalog writes.
--id <ID> Snapshot ID to operate on.
-j, --jobs <N> Max concurrent object transfers. Env: SNAPDIR_JOBS.
--limit-rate <RATE> Limit aggregate transfer bandwidth. Env: SNAPDIR_LIMIT_RATE.
--adaptive[=<FRACTION>] Adaptively tune transfer concurrency/bandwidth. Env: SNAPDIR_ADAPTIVE.
--max-jobs <N> Adaptive concurrency ceiling. Env: SNAPDIR_MAX_JOBS.
--max-retries <N> Total retry attempts per network request, including the first.
--retry-base-ms <MS> Base retry backoff delay in milliseconds.
--retry-max-ms <MS> Maximum retry backoff delay in milliseconds.
--max-requests <N> Cap request rate; 0/unset uses the backend default.
--linked Accepted by the shared transfer parser; stage writes objects into the cache and does not create a linked checkout.
--force Force an action to run.
--keep Keep the staging directory.
--dryrun Run without making changes.
-q, --quiet / --no-progress / --color <WHEN> / --verbose Universal output-control options.

Stage snapshots a quiescent tree. If the input changes during the walk, staging fails with an in-flux error rather than recording an incoherent snapshot.

Examples

Stage the current directory into the default cache:

snapdir stage .

Stage into a specific cache directory:

snapdir stage --cache-dir /var/snapdir/cache ./project

See also