Skip to content

Make restore overwrite behavior configurable #4817

@MichaelEischer

Description

@MichaelEischer

Restore should implement additional options to make it more flexible. This is a tracking issue that sums up several existing issues.

New overwrite behaviors

Skip existing:

  • --ignore-existing
  • does not overwrite already existing files

Always overwrite (default):

  • --delete option to remove files not in the snapshot
  • will also overwrite readonly files etc.
  • if a file would overwrite a non-empty directory, refuse to do so unless --delete is also specified. That semantic is also used by rsync

Overwrite if newer:

  • --overwrite-if-newer (rsync --update) replaces local files if the snapshot content is newer (by file timestamp!)
  • allow implementing some kind of sync
  • --delete option works the same way as for "Always overwrite"

Optimizations:

  • restore only changed files: user can select to trust timestamp+size (default) or to let restic check the file contents of everything

Addresses Issues:

Metadata

Metadata

Labels

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions