Do not prune after a backup that found a configured path empty (closes #388)
check / check (push) Waiting to run
check / check (push) Waiting to run
snapshot create --prune of a snapshot whose path was an empty directory, as the mount point of a volume that is not mounted is, recorded an empty snapshot and then purged the older snapshots that held the data, with their blobs. The scan now counts the entries it finds in each configured path. Under --prune, a run in which a path of a snapshot it made held nothing skips the prune, keeps every older snapshot, names each such path with its snapshot, and exits non-zero, as #382 does for unreadable files. Only the current run is looked at. Without --prune this check does nothing. A configured path that is a symlink whose target is gone now fails every run, with or without --prune. Model: opus-5-5
This commit is contained in:
@@ -115,8 +115,9 @@ on Linux), then /etc/vaultik/config.yml.`,
|
||||
return
|
||||
}
|
||||
|
||||
if errors.Is(err, vaultik.ErrFilesUnreadable) {
|
||||
log.Error("Backup completed with unreadable files", "error", err)
|
||||
if errors.Is(err, vaultik.ErrFilesUnreadable) ||
|
||||
errors.Is(err, vaultik.ErrSourcePathEmpty) {
|
||||
log.Error("Backup completed with an error", "error", err)
|
||||
ReportErrorf("Backup completed, but %v", err)
|
||||
|
||||
return
|
||||
@@ -133,7 +134,8 @@ 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)")
|
||||
"backup that skipped unreadable files or found a configured "+
|
||||
"path empty)")
|
||||
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