Skip to content
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

Closed
wants to merge 4 commits into from
Closed

Conversation

jmontleon
Copy link

@jmontleon jmontleon commented Mar 15, 2019

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

  • I have read the Contribution Guidelines
  • I have added tests for all changes in this PR
  • I have added documentation for the changes (in the manual)
  • There's a new file in changelog/unreleased/ that describes the changes for our users (template here)
  • I have run gofmt on the code in all commits
  • All commit messages are formatted in the same style as the other commits in the repo
  • I'm done, this Pull Request is ready for review

@ifedorenko
Copy link
Contributor

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) {
Copy link
Contributor

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

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.

Copy link
Author

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.

"path/filepath"
)

func DeleteFiles(ctx context.Context, target string, host string, paths []string, tags []restic.TagList, repo restic.Repository, id restic.ID) error {

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

@fd0
Copy link
Member

fd0 commented Nov 5, 2020

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!

@fd0 fd0 closed this Nov 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants