Skip to content

Make restore overwrite behavior configurable#4837

Merged
MichaelEischer merged 14 commits intorestic:masterfrom
MichaelEischer:restore-options
Jun 12, 2024
Merged

Make restore overwrite behavior configurable#4837
MichaelEischer merged 14 commits intorestic:masterfrom
MichaelEischer:restore-options

Conversation

@MichaelEischer
Copy link
Copy Markdown
Member

What does this PR change? What problem does it solve?

The restore command now supports an --overwrite option to configure whether already existing files are overwritten. The default is --overwrite always, which overwrites existing files. --overwrite if-newer only restores files from the snapshot that are newer than the local state. And --overwrite never does not modify existing files.

The --overwrite option replaces the --ignore-existing and --overwrite-if-newer flags from #4817 .

Was the change previously discussed in an issue or on the forum?

Fixes #200.
See #4817 .

Checklist

  • I have read the contribution guidelines.
  • I have enabled maintainer edits.
  • I have added tests for all code changes.
  • I have added documentation for relevant changes (in the manual).
  • There's a new file in changelog/unreleased/ that describes the changes for our users (see template).
  • 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.

Copy link
Copy Markdown
Member Author

@MichaelEischer MichaelEischer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. The --overwrite option name is not completely final yet. There's a chance it will be renamed to e.g. --policy skip|update-if-newer|update-if-changed|update-always suggested by @rawtaz.

@MichaelEischer MichaelEischer merged commit 663151d into restic:master Jun 12, 2024
@MichaelEischer MichaelEischer deleted the restore-options branch June 12, 2024 20:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

Feature request: "Restore newer/missing datasets" / "synchronize"

1 participant