Skip vaultik's own index and PID file in a backup (closes #421)
check / check (push) Successful in 11m31s

A backup of a directory that holds the local index stored a torn copy
of it, its -wal and -shm side files and vaultik.pid, all being written
while they were read. The scan now treats these files as excluded,
whatever the config says. Their paths come from index_path and the lock
directory, with symlinks in their directories resolved the way source
paths are. pidlock now owns the lock directory and the PID file name,
so the CLI and the scanner use the same path.

Model: opus-5-5
This commit is contained in:
sneak committed 2026-11-11 00:22:57 +00:00
1 parent aae7fa17ae
commit 4301a7e246
7 files changed
+175 -6

No files matched your search

+11
View File
@@ -20,6 +20,17 @@ const indexDirPerm = 0o700
// backed-up path and chunk hash and must stay private.
const indexFilePerm = 0o600
// IndexFiles returns the path of the index at indexPath and the paths of
// the side files SQLite keeps beside it while it writes.
func IndexFiles(indexPath string) []string {
return []string{
indexPath,
indexPath + "-wal",
indexPath + "-shm",
indexPath + "-journal",
}
}
// ensureIndexFileMode makes the index file owner-only before the SQLite
// driver opens it: it creates the file 0600 if absent, or chmods an existing
// one to 0600. Doing this first matters because SQLite creates its -wal and