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

wants to merge 4 commits into
base: master


None yet
3 participants
Copy link

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.


  • 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

This comment has been minimized.

Copy link

commented Mar 15, 2019

This is similar/related to #2012.

@@ -90,6 +90,15 @@ func (res *Restorer) traverseTree(ctx context.Context, target, location string,

if skipUnchanged {
if targetFile, err := os.Stat(nodeTarget); !os.IsNotExist(err) {

This comment has been minimized.

Copy link

ifedorenko Mar 15, 2019


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.

This comment has been minimized.

Copy link

jmontleon Mar 19, 2019


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.

jmontleon added some commits Mar 14, 2019

@jmontleon jmontleon force-pushed the jmontleon:skip-unchanged branch from 9d4fbb4 to fce1ebe Mar 20, 2019


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

This comment has been minimized.

Copy link

houndci-bot Mar 20, 2019

exported function DeleteFiles should have comment or be unexported

@jmontleon jmontleon force-pushed the jmontleon:skip-unchanged branch from 6054592 to 222167b Mar 22, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.