Do not prune after a backup that found a volume not mounted (closes #395)
check / check (push) Canceled after 0s
check / check (push) Canceled after 0s
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:
@@ -1,6 +1,8 @@
|
||||
package snapshot
|
||||
|
||||
import (
|
||||
"os"
|
||||
|
||||
"github.com/spf13/afero"
|
||||
"go.uber.org/fx"
|
||||
"sneak.berlin/go/vaultik/internal/config"
|
||||
@@ -19,6 +21,9 @@ type ScannerParams struct {
|
||||
// PreviousSnapshotID is the most recent completed snapshot of the
|
||||
// same name, "" for none.
|
||||
PreviousSnapshotID string
|
||||
// DeviceNumber is ScannerConfig.DeviceNumber; nil reads it from the
|
||||
// file's stat.
|
||||
DeviceNumber func(info os.FileInfo) (uint64, bool)
|
||||
}
|
||||
|
||||
// Module exports backup functionality as an fx module.
|
||||
@@ -59,6 +64,7 @@ func provideScannerFactory(
|
||||
Exclude: excludes,
|
||||
SkipErrors: params.SkipErrors,
|
||||
PreviousSnapshotID: params.PreviousSnapshotID,
|
||||
DeviceNumber: params.DeviceNumber,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user