Add snapshot create --dry-run to show what excludes keep and drop (closes #436)
check / check (push) Waiting to run

The dry run scans the source paths, reads the local index to tell
unchanged files from new and changed ones, and prints the files
examined, to back up and unchanged, their sizes, and the count of
excluded entries. With --verbose it prints each excluded entry and the
pattern that matched it. It writes nothing to the local index or the
destination, takes no lock, and refuses --prune.

Model: opus-5-5
This commit is contained in:
sneak committed 2026-11-19 07:02:34 +00:00
1 parent d747ddef3a
commit 95add7fc38
8 files changed
+492 -58

No files matched your search

+12 -1
View File
@@ -169,7 +169,7 @@ vaultik [--config <path>] config init
vaultik [--config <path>] config edit
vaultik [--config <path>] config get <key>
vaultik [--config <path>] config set <key> <value>
vaultik [--config <path>] snapshot create [snapshot-names...] [--cron] [--prune] [--keep-newer-than <duration>]
vaultik [--config <path>] snapshot create [snapshot-names...] [--cron] [--prune] [--keep-newer-than <duration>] [--dry-run]
vaultik [--config <path>] snapshot list [--json] # alias: ls
vaultik [--config <path>] snapshot files <snapshot-id> [path] [--json]
vaultik [--config <path>] snapshot verify <snapshot-id> [--deep] [--json]
@@ -369,6 +369,17 @@ In such a config, an unknown key or a value of the wrong type is refused.
duration instead of only the latest (e.g. `4w`, `30d`, `6mo`, `1y`). Without
`--prune`, or with a value that is not a valid duration, the command fails
before the backup starts.
- `--dry-run`: Scan the source paths and print what a backup would store,
without storing it. The summary gives the files examined, to back up and
unchanged, their sizes, and the count of excluded entries. An excluded
directory counts once, since the scan does not enter it. With `--verbose`, it
also prints each excluded entry and the exclude pattern that matched it. It
writes nothing to the destination and records nothing in the local index, so
it does not bind the index to the destination. Like the other commands that
read the local index, it creates an empty one if there is none. When the local
index holds an incomplete snapshot from an interrupted backup, it says so: the
next backup drops that snapshot first and may back up more files than the dry
run counts. It cannot be combined with `--prune`.
- Fails before it writes anything when a `file://` destination directory does
not exist, or when the local index holds snapshots and the destination answers
that it has no `vaultik-destination.txt`. When that look-up fails for any