Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: Support for multiple repositories #4604

Open
Gnarflord opened this issue Jun 4, 2019 · 5 comments
Open

Feature request: Support for multiple repositories #4604

Gnarflord opened this issue Jun 4, 2019 · 5 comments

Comments

@Gnarflord
Copy link

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:

  • When using "borg init" one should be able to give multiple paths for repo creation.

  • "borg create" should have two modes, depending on user preferences:

    • Push the backup to all repositories
    • Push the backup to the repository with the oldest incremental backup. This will result in equal usage of the repos/disks
  • Any other command should work with the most recent backup of course.

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
Copy link
Contributor

Related issue #4454

@ThomasWaldmann
Copy link
Member

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
Copy link
Contributor

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
Copy link
Member

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

  • borg transfer (efficiently copy and archive to a related repo)
  • borg rcreate (create a repo, create a related repo)

Some more might come in future.

@ThomasWaldmann
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants