Do not prune after a backup that found a volume not mounted (closes #395)
check / check (push) Waiting to run
check / check (push) Waiting to run
snapshot create --prune purged the older snapshots holding a volume's files when the volume, mounted below a configured path, was not mounted: its empty mount point read as deleted files. The scan now records in the local index each directory at or below a configured path that is on a different device from its parent directory. Under --prune, a run that does not find such a directory recorded by an earlier snapshot of that name skips the prune, keeps every older snapshot, names the directory and its snapshot, and exits non-zero, as for an empty configured path. A volume retired on purpose is cleared by removing the older snapshots with snapshot purge. Model: opus-5-5
This commit is contained in:
@@ -116,7 +116,8 @@ on Linux), then /etc/vaultik/config.yml.`,
|
||||
}
|
||||
|
||||
if errors.Is(err, vaultik.ErrFilesUnreadable) ||
|
||||
errors.Is(err, vaultik.ErrSourcePathEmpty) {
|
||||
errors.Is(err, vaultik.ErrSourcePathEmpty) ||
|
||||
errors.Is(err, vaultik.ErrVolumeNotMounted) {
|
||||
log.Error("Backup completed with an error", "error", err)
|
||||
ReportErrorf("Backup completed, but %v", err)
|
||||
|
||||
@@ -134,8 +135,9 @@ on Linux), then /etc/vaultik/config.yml.`,
|
||||
cmd.Flags().BoolVar(&opts.Prune, "prune", false,
|
||||
"After backup, drop older snapshots of the same name and remove "+
|
||||
"orphaned blobs older than prune_grace_period (not after a "+
|
||||
"backup that skipped unreadable files or found a configured "+
|
||||
"path empty)")
|
||||
"backup that skipped unreadable files, found a configured "+
|
||||
"path empty, or found no volume where an earlier snapshot "+
|
||||
"found one mounted)")
|
||||
cmd.Flags().StringVar(&opts.KeepNewerThan, "keep-newer-than", "",
|
||||
"With --prune: keep snapshots newer than this duration "+
|
||||
"(e.g. 30d, 4w, 6mo, 1y; m is minutes, mo is months) "+
|
||||
|
||||
Reference in New Issue
Block a user