New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add --skip-unchanged option #2207
Conversation
This is similar/related to #2012. |
@@ -90,6 +90,15 @@ func (res *Restorer) traverseTree(ctx context.Context, target, location string, | |||
continue | |||
} | |||
|
|||
if skipUnchanged { | |||
if targetFile, err := os.Stat(nodeTarget); !os.IsNotExist(err) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be the same as
restic/internal/archiver/archiver.go
Line 439 in 7b8d1dc
func fileChanged(fi os.FileInfo, node *restic.Node) bool { |
Most likely need a helper somewhere, so both archiver and restorer can use it.
Also see #2179.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the links to the other PR and issue. I'll look these over and see if I can implement this as a helper to work with the archiver as well.
9d4fbb4
to
fce1ebe
Compare
"path/filepath" | ||
) | ||
|
||
func DeleteFiles(ctx context.Context, target string, host string, paths []string, tags []restic.TagList, repo restic.Repository, id restic.ID) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exported function DeleteFiles should have comment or be unexported
6054592
to
222167b
Compare
What's the status of this PR? The "I'm ready" box hasn't been checked and there was no activity for over a year, so I'm closing it for now. Please leave a comment if you're still interested in working on it, so we can reopen the PR. Thanks a lot! |
What is the purpose of this change? What does it change?
Adds an option --skip-unchanged to restore. When set restic skips restoring files in the target location which appear to be unchanged based on size and mod time.
Was the change discussed in an issue or in the forum before?
I have seen some forum discussion on the idea, no issues that I am aware of yet.
Checklist
changelog/unreleased/
that describes the changes for our users (template here)gofmt
on the code in all commits