Skip to main content

Restic Repository

@sntxrr/restic-repositoryv2026.10.22.1· MIT· 1mo agoBEHAVIORSACCEPTED WARNINGS
01README

Validate one restic repository from a neutral host — snapshot freshness and backup-scope drift, structural check, read-data verification against bitrot, a dump canary, and a size-capped restore drill that proves the backup can actually be restored. Strictly read-only: it refuses every restic write command and never takes a repository lock, so it can never break the backup it validates.

02Behaviors1
@sntxrr/restic/repositoryv2026.10.22.1restic_repository.ts

Global Arguments

ArgumentTypeDescription
repositorystringrestic repository URL, e.g. s3:s3.us-west-002.backblazeb2.com/<bucket>
passwordstringRepository password — supply via vault.get(), never inline.
accessKeyIdstringB2 application key ID. Needs only listBuckets, readBuckets, listFiles
secretAccessKeystringB2 application key — supply via vault.get(), never inline.
resticBinary?stringPath to the restic binary. Defaults to `restic` on PATH. Use an
cacheDir?stringRESTIC_CACHE_DIR. Set it explicitly — clearEnv means there is nothing
expectedPaths?arrayPaths this repository is expected to contain. Compared against the
excludeTags?arraySnapshots carrying any of these tags are never treated as the latest
transportRetryDelaySeconds?numberWait before the single re-run of a check that failed only on
dormant?booleanDeclare this repository deliberately inactive (host powered off or
maxStaleDays?numberAge in days beyond which the latest snapshot is stale. Default 2.
maxRestoreBytes?numberByte ceiling for a restore drill, checked BEFORE any data moves.
timeoutMinutes?numberPer-invocation timeout. Default 30.
allowUnlock?booleanPermit `unlock` to remove stale locks. Can also be passed per run.
fn scan(mode?: enum, maxSnapshots?: number)
Rung 1. Inventory the repository: snapshot count and age, hostnames,
ArgumentTypeDescription
mode?enumaggregate (default) writes one repository resource; detailed also
maxSnapshots?numberCap on snapshot resources emitted in detailed mode. Default 200.
fn check()
Rung 2. Structural check of index, trees and pack metadata. This
fn verify(subset?: string)
Rung 3. Download and hash-verify a subset of pack files — the
ArgumentTypeDescription
subset?stringSubset to read: 'n/t' (deterministic partition, t<=256), 'x%', or a
fn dump(path: string, snapshot?: string, expectedSha256?: string)
Rung 4. Stream one known file out of a snapshot and hash it,
ArgumentTypeDescription
pathstringAbsolute path of the canary file inside the snapshot.
snapshot?stringSnapshot ID. Default: the newest snapshot not carrying an excludeTags
expectedSha256?stringIf given, the dump fails unless the content hash matches.
fn restore(path: string, target: string, snapshot?: string, maxRestoreBytes?: number)
Rung 5. Restore a scoped subtree, or a single file, to a local
ArgumentTypeDescription
pathstringSubtree or single file inside the snapshot to restore, e.g. /etc or
targetstringLocal directory to restore into. Contents are overwritten.
snapshot?stringSnapshot ID. Default: the newest snapshot not carrying an excludeTags
maxRestoreBytes?numberOverride the byte ceiling for this run only.
fn unlock(allowUnlock?: boolean)
Remove STALE locks (older than 30 minutes) — the only write this
ArgumentTypeDescription
allowUnlock?booleanPer-run acknowledgement. Required unless set as a global argument.

Resources

repository(infinite)— Freshness and identity of one restic repository — snapshot age,
snapshot(infinite)— One restic snapshot, emitted only in detailed scan mode,
validation(infinite)— The outcome of one validation-ladder rung — whether it passed, and
maintenance(infinite)— A record of the one mutation this suite performs — a stale-lock
03Previous Versions4
2026.10.19.1MIT
2026.10.14.1MIT(was none)

Declare SPDX license (MIT) in manifest.

Modified 1 behaviors

2026.08.07.2
2026.08.07.1
04Stats
A
100 / 100
Downloads
78
Archive size
33.8 KB
  • Has README or module doc2/2earned
  • README has a code example1/1earned
  • README is substantive1/1earned
  • Most symbols documented1/1earned
  • No slow types (deprecated)1/1earned
  • Dependencies pass trust audit2/2earned
  • Has description1/1earned
  • Platform support declared (or universal)2/2earned
  • License2/2earned
  • Verified public repository2/2earned

06Platforms
07Labels