Restic Repository
@sntxrr/restic-repositoryv2026.10.22.1
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.
02Behaviors
@sntxrr/restic/repositoryv2026.10.22.1restic_repository.ts
Global Arguments
| Argument | Type | Description |
|---|---|---|
| repository | string | restic repository URL, e.g. s3:s3.us-west-002.backblazeb2.com/<bucket> |
| password | string | Repository password — supply via vault.get(), never inline. |
| accessKeyId | string | B2 application key ID. Needs only listBuckets, readBuckets, listFiles |
| secretAccessKey | string | B2 application key — supply via vault.get(), never inline. |
| resticBinary? | string | Path to the restic binary. Defaults to `restic` on PATH. Use an |
| cacheDir? | string | RESTIC_CACHE_DIR. Set it explicitly — clearEnv means there is nothing |
| expectedPaths? | array | Paths this repository is expected to contain. Compared against the |
| excludeTags? | array | Snapshots carrying any of these tags are never treated as the latest |
| transportRetryDelaySeconds? | number | Wait before the single re-run of a check that failed only on |
| dormant? | boolean | Declare this repository deliberately inactive (host powered off or |
| maxStaleDays? | number | Age in days beyond which the latest snapshot is stale. Default 2. |
| maxRestoreBytes? | number | Byte ceiling for a restore drill, checked BEFORE any data moves. |
| timeoutMinutes? | number | Per-invocation timeout. Default 30. |
| allowUnlock? | boolean | Permit `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,
| Argument | Type | Description |
|---|---|---|
| mode? | enum | aggregate (default) writes one repository resource; detailed also |
| maxSnapshots? | number | Cap 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
| Argument | Type | Description |
|---|---|---|
| subset? | string | Subset 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,
| Argument | Type | Description |
|---|---|---|
| path | string | Absolute path of the canary file inside the snapshot. |
| snapshot? | string | Snapshot ID. Default: the newest snapshot not carrying an excludeTags |
| expectedSha256? | string | If 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
| Argument | Type | Description |
|---|---|---|
| path | string | Subtree or single file inside the snapshot to restore, e.g. /etc or |
| target | string | Local directory to restore into. Contents are overwritten. |
| snapshot? | string | Snapshot ID. Default: the newest snapshot not carrying an excludeTags |
| maxRestoreBytes? | number | Override the byte ceiling for this run only. |
fn unlock(allowUnlock?: boolean)
Remove STALE locks (older than 30 minutes) — the only write this
| Argument | Type | Description |
|---|---|---|
| allowUnlock? | boolean | Per-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 Versions
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
Repository
https://github.com/sntxrr/swamp-resticdeno-command1 accepted
Spawns a subprocess with Deno.Command().
- models/restic_repository.ts:118 — no reason given
06Platforms
07Labels