restore: skip unchanged files and add --overwrite if-changed option#4838
Merged
MichaelEischer merged 9 commits intorestic:masterfrom Jun 13, 2024
Merged
Conversation
9 tasks
632cca9 to
20e30a9
Compare
--verify-existing option--overwrite if-changed option
Member
Author
|
Updated after discussion with @rawtaz. Instead of |
00c80d7 to
34d1cf5
Compare
Member
Author
|
|
dc5e64a to
142d7d3
Compare
The assumption that a file is not readonly is no longer valid.
e5345d5 to
c684257
Compare
For files that should be overwritten, first check whether their content matches the snapshot and only restore diverging parts.
… matches --overwrite=always still checks the file content
c684257 to
d890bff
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR change? What problem does it solve?
Based on #4837 .
On startup, the
restorecommand now checks existing files to determine whether these have to be updated. By default, it verifies the full file content. To only checks whether the file size and modification time (mtime) match with those in the snapshot, use--overwrite if-changed. Files with matching file content will not be downloaded during the restore operation. Only their file metadata is updated.Was the change previously discussed in an issue or on the forum?
See #4817
Fixes #407
Fixes #2662
Checklist
changelog/unreleased/that describes the changes for our users (see template).gofmton the code in all commits.