Skip to content

restore: add --delete option#4881

Merged
MichaelEischer merged 12 commits intorestic:masterfrom
MichaelEischer:restore-delete-actual
Jul 5, 2024
Merged

restore: add --delete option#4881
MichaelEischer merged 12 commits intorestic:masterfrom
MichaelEischer:restore-delete-actual

Conversation

@MichaelEischer
Copy link
Copy Markdown
Member

@MichaelEischer MichaelEischer commented Jun 29, 2024

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

Adds a --delete option to the restore command that deletes files from the target folder that do not exist in the snapshot. Files are only deleted if they match the --include or --exclude filters. In addition, a non-empty directory can be overwritten if the snapshots contains a file in its place.

See the documentation for more details.

Includes #4839 .

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

Fixes #2348

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.

@MichaelEischer MichaelEischer force-pushed the restore-delete-actual branch 3 times, most recently from f293f76 to 53afd92 Compare June 29, 2024 21:10
@MichaelEischer MichaelEischer force-pushed the restore-delete-actual branch from 53afd92 to 317a101 Compare July 5, 2024 19:04
@MichaelEischer MichaelEischer force-pushed the restore-delete-actual branch from 317a101 to 5431697 Compare July 5, 2024 20:39
@MichaelEischer MichaelEischer merged commit 8e27a93 into restic:master Jul 5, 2024
@MichaelEischer MichaelEischer deleted the restore-delete-actual branch July 5, 2024 20:52
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.

Option for restic restore to delete local files not in snapshot

1 participant