borgbackup / borg

Deduplicating archiver with compression and authenticated encryption.
https://www.borgbackup.org/
Other
11.08k stars 738 forks source link

Feature request: Support for multiple repositories #4604

Open Gnarflord opened 5 years ago

Gnarflord commented 5 years ago

Currently, if we want to secure ourselves against disk failure it's recommended to create two separate borg repositories on separate media and let the client decide where it should push it's backup. I'd like to add a feature, which lets borg handle multiple repositories without annoying the user with the management aspect.

Some thoughs:

This should be fairly straight-forward* by adding a generic handler which chooses the right repos and calls the desired command with it.

The reason I want to add those changes is because it would allow for some broader setups. For example consider three disks with repos, of which two are at all times in the backup server and the third at some secure offline location. Regularly one could rotate the disks and let borg automatically fill the oldest one.

Before I start programming I'd like to ask if this feature is wanted or even makes sense. Also I'm not quite sure about the syntax yet. It'd be possible to append something like

--repos path/to/repo1 path/to/repo2...

to every command but that'd become quite cumbersome. Maybe save the locations as a repo-config and let every repo be aware of it's sister repos?

Any thoughts?

(*) famous last words

infectormp commented 5 years ago

Related issue https://github.com/borgbackup/borg/issues/4454

ThomasWaldmann commented 5 years ago

Yup, see #4454.

I somehow feel that the added complexity in the code / error handling / the additional documentation needs by far outweighs whatever might be gained with this feature.

fantasya-pbem commented 4 years ago

Such behaviour with swtching between multiple repos could be implemented in a short script, which may be the better solution. For example, one could have two locations (0, 1) and choose one by calculating DAY(DATE) mod 2. I don't think Borg needs a choose-a-repo functionality.

ThomasWaldmann commented 1 year ago

borg 2 will have some very limited support to work with multiple repos:

Some more might come in future.

ThomasWaldmann commented 4 weeks ago

As #8332 did some rather fundamental changes to how the repository works in borg2 (using borgstore now), we maybe could use borgstore's MStore for that.