Refuse a backup destination an unplugged volume left empty (closes #239)
check / check (push) Failing after 3m38s

Every backup now writes vaultik-destination.txt at the root of the
backup destination store. While the local index holds snapshots, a
destination without it is treated as not present: snapshot create
refuses before writing anything, prune and snapshot purge fail, and
snapshot list and snapshot remove warn, as for a destination that cannot
be listed. remote nuke deletes the marker last. The file:// backend no
longer creates its destination directory and checks for it on every
write.

Tests that backed up into a directory they never created now use an
existing one; fixtures that stand for a written destination carry the
marker.

Judgement call: the marker is rewritten on every backup.
Deviation: snapshot name selection moved out of CreateSnapshot, unchanged, to stay within the complexity limit.

Model: opus-5-5
This commit is contained in:
2026-10-13 01:16:47 +00:00
parent c9a519c233
commit eff3d67447
35 changed files with 543 additions and 98 deletions
+2 -1
View File
@@ -41,7 +41,8 @@ type Info struct {
// directory for filesystem).
type Storer interface {
// Put stores data at the specified key.
// Parent directories are created automatically for filesystem backends.
// The filesystem backend fails when its destination directory does
// not exist, and creates the directories below it as needed.
Put(ctx context.Context, key string, data io.Reader) error
// PutWithProgress stores data with progress reporting.