diff --git a/ARCHITECTURE.md b/ARCHITECTURE.md index 1892f78..a58cacd 100644 --- a/ARCHITECTURE.md +++ b/ARCHITECTURE.md @@ -299,7 +299,7 @@ database is honest. The restore therefore checks it: the remote key that was asked for. - `containedRestorePath` refuses a stored path that would leave the target directory. It also refuses to write through a symlink below the target. -- A blob is not decompressed beyond the size the database records for it. +- A blob is not decompressed beyond the size that the database gives for it. - Each downloaded blob is hashed. The hash must match the blob's name. ### Order of work diff --git a/README.md b/README.md index 8b6ff63..7064798 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,7 @@ It was written to meet these requirements together: - **Blob**: one object at the destination. It holds many chunks, compressed and then encrypted. - **Local index**: a SQLite database on the backed-up machine. It records what - is already stored, so the next backup uploads only what changed. + is already stored, so the next backup does not upload it again. - **Manifest**: the list of blobs one snapshot uses. It is stored at the destination without encryption. - **Remote key**: a hash of the snapshot ID. It names the snapshot's directory @@ -405,8 +405,8 @@ the local index. Its timestamp is the time its backup finished. The command reports these below the table: -- Snapshots in the local index that are missing at the destination. Run - `vaultik prune` to drop those records. +- Snapshots that are in the local index but have no manifest at the destination. + Run `vaultik prune` to drop them from the local index. - Remote-only snapshots whose manifest cannot be read. They are left out of the table. - Remote-only snapshots beyond the first 1000. They are left out of the table. @@ -493,13 +493,14 @@ Flags: The command acts only on snapshots in the local index. `--keep-latest` keeps the newest snapshot of each name, not the newest overall. -The command removes each such snapshot from the local index. It also deletes the -snapshot's directory under `metadata/` at the destination. Its blobs stay. Run -`vaultik prune` afterwards to delete the blobs that no snapshot uses any more. +The command removes from the local index each snapshot that the flags select. It +also deletes the snapshot's directory under `metadata/` at the destination. Its +blobs stay. Run `vaultik prune` afterwards to delete the blobs that no snapshot +uses any more. -The command first drops local records of snapshots that are no longer at the -destination. It fails and removes nothing when the destination cannot be listed -or has no marker file. +The command first drops from the local index each snapshot whose manifest is +gone from the destination. It fails and removes nothing when the destination +cannot be listed or has no marker file. ### `snapshot remove ` @@ -732,16 +733,18 @@ vaultik completion fish > ~/.config/fish/completions/vaultik.fish ### `version` -Prints the version, the commit, the build date and the platform. It also says -when the binary is a development build, not a release. +Prints the version, the commit, the commit date and the platform. It labels the +commit date `build date`. It also says when the binary is a development build, +not a release. ## Configuration The config file is YAML. `vaultik config init` writes one to start from, and [`config.example.yml`](config.example.yml) is a longer example. -A command refuses to start when the config does not load. The config loads when -all of these hold: +A command refuses to start when the config does not load. The `config` commands, +`completion` and `version` are the exceptions. The config loads when all of +these hold: - Every entry in `age_recipients` is an age X25519 public key. - `snapshots` has at least one name, and every name has at least one path. diff --git a/docs/DATAMODEL.md b/docs/DATAMODEL.md index 090f93e..efbbd74 100644 --- a/docs/DATAMODEL.md +++ b/docs/DATAMODEL.md @@ -6,7 +6,7 @@ index. This document describes its tables and how each command uses them. The local index has two jobs: - It records which files, chunks and blobs are already stored. The next backup - then uploads only what changed. + then does not store them again. - It is the source of each snapshot's own database. A backup uploads a trimmed, encrypted copy of the index with every snapshot. diff --git a/docs/REPOSTRUCTURE.md b/docs/REPOSTRUCTURE.md index 69b5c3f..74db889 100644 --- a/docs/REPOSTRUCTURE.md +++ b/docs/REPOSTRUCTURE.md @@ -142,8 +142,9 @@ remote key keeps names out of a listing. It does not hide them from a guess. The snapshot's database. A restore needs it. -- **Contents**: a SQLite database that holds this snapshot only. It lists every - file with its metadata, its chunks, and the blob that holds each chunk. +- **Contents**: a SQLite database. It is a copy of the local index without the + rows of other snapshots. It lists every file in the snapshot with its + metadata, its chunks, and the blob that holds each chunk. - **Format**: the database file, compressed with zstd and then encrypted with age. diff --git a/internal/cli/prune.go b/internal/cli/prune.go index 44e00f8..b74e45b 100644 --- a/internal/cli/prune.go +++ b/internal/cli/prune.go @@ -20,7 +20,7 @@ from the backup destination store. Needs permission to list, read and delete objects on the destination store. It does not need the age private key. -Local cleanup drops snapshots whose metadata is gone from the +Local cleanup drops snapshots whose manifest is gone from the destination store, incomplete snapshots, and any files, chunks, or blobs no longer referenced by a completed snapshot. Remote cleanup scans every snapshot manifest in the destination store, builds the