Skip vaultik's own index and PID file in a backup (closes #421)
check / check (push) Failing after 20m56s
check / check (push) Failing after 20m56s
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. If index_path is itself a symlink, SQLite writes the file it points to, so that file and its side files are skipped too. pidlock now owns the lock directory and the PID file name, so the CLI and the scanner use the same path. database delete now removes the side files database.IndexFiles lists, the -journal file included. Model: opus-5-5
This commit is contained in:
1 parent
0d0c76fa24
commit
17ab7b16ee
10 files changed
+295
-17
No files matched your search
@@ -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
|
||||
|
||||
Reference in new issue
Block a user