mirror of
https://github.com/octoleo/restic.git
synced 2024-11-25 22:27:35 +00:00
Merge pull request #3645 from greatroar/stdin-parent
Don't set a parent for --stdin backups
This commit is contained in:
commit
ad4f4dbc7a
13
changelog/unreleased/issue-3641
Normal file
13
changelog/unreleased/issue-3641
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
Change: Backups from stdin no longer have a parent
|
||||||
|
|
||||||
|
Snapshots made with `restic backup --stdin` no longer have a parent snapshot.
|
||||||
|
Since parent snapshots are only used to skip files in the scanning phase
|
||||||
|
based on filename and timestamps, the parent snapshot of a `--stdin` snapshot
|
||||||
|
was meaningless to begin with. Not setting a parent allows `restic backup`
|
||||||
|
to skip some startup operations.
|
||||||
|
|
||||||
|
The `--parent` option is still available for `restic backup --stdin`,
|
||||||
|
but is now ignored.
|
||||||
|
|
||||||
|
https://github.com/restic/restic/issues/3641
|
||||||
|
https://github.com/restic/restic/pull/3645
|
@ -579,7 +579,9 @@ func runBackup(opts BackupOptions, gopts GlobalOptions, term *termstatus.Termina
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
parentSnapshotID, err := findParentSnapshot(gopts.ctx, repo, opts, targets, timeStamp)
|
var parentSnapshotID *restic.ID
|
||||||
|
if !opts.Stdin {
|
||||||
|
parentSnapshotID, err = findParentSnapshot(gopts.ctx, repo, opts, targets, timeStamp)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@ -591,6 +593,7 @@ func runBackup(opts BackupOptions, gopts GlobalOptions, term *termstatus.Termina
|
|||||||
progressPrinter.P("no parent snapshot found, will read all files\n")
|
progressPrinter.P("no parent snapshot found, will read all files\n")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
selectByNameFilter := func(item string) bool {
|
selectByNameFilter := func(item string) bool {
|
||||||
for _, reject := range rejectByNameFuncs {
|
for _, reject := range rejectByNameFuncs {
|
||||||
|
Loading…
Reference in New Issue
Block a user