Multiple repositories with dedicated source_directories in one config #118

Closed
opened 2018-12-19 17:44:29 +00:00 by patricko · 6 comments

If we put source_directories with multiple repositories, each repository will have the same directories backed up, right?

So if I want to have a repository for one thing and another for something else, I must create two config files?

That's a bit annoying if so

WHy not a:

repositories:
  - path: "/path/to/repo"
    source_directories:
      - "dir1"
      - "dir2"

Note: I don't exactly understand why there is a list actually for "repositories", is it to make a backup in different sites?

If we put source_directories with multiple repositories, each repository will have the same directories backed up, right? So if I want to have a repository for one thing and another for something else, I must create two config files? That's a bit annoying if so WHy not a: ``` repositories: - path: "/path/to/repo" source_directories: - "dir1" - "dir2" ``` Note: I don't exactly understand why there is a list actually for "repositories", is it to make a backup in different sites?
Owner

If you have multiple repositories listed in a single config file then, yes, each repository will have the same source directories backed up. Here's the comment/documentation on borgmatic repositories:

    # Paths to local or remote repositories (required). Tildes are expanded. Multiple
    # repositories are backed up to in sequence. See ssh_command for SSH options like
    # identity file or port.

The rationale is that the user may want to create multiple identical backups with different providers for increased redundancy. For instance, one local repository for quick access to files and one remote repository in case the local repository is destroyed. Or just two different remote repositories in different physical locations.

So if I want to have a repository for one thing and another for something else, I must create two config files?

If you mean one repository with one set of source directories, and another repository with a different set of source directories, then yes, you'll need two different config files right now.

As for your nested repositories / source_directories suggestion, you may want to check out some of the prior discussion on this ticket: witten/borgmatic#73

Could you say a little more about the issue with multiple configuration files? Is it just that you'd find yourself having to duplicate configuration among them?

If you have multiple `repositories` listed in a single config file then, yes, each repository will have the same source directories backed up. Here's the comment/documentation on borgmatic `repositories`: ```raw # Paths to local or remote repositories (required). Tildes are expanded. Multiple # repositories are backed up to in sequence. See ssh_command for SSH options like # identity file or port. ``` The rationale is that the user may want to create multiple identical backups with different providers for increased redundancy. For instance, one local repository for quick access to files and one remote repository in case the local repository is destroyed. Or just two different remote repositories in different physical locations. > So if I want to have a repository for one thing and another for something else, I must create two config files? If you mean one repository with one set of source directories, and another repository with a different set of source directories, then yes, you'll need two different config files right now. As for your nested `repositories` / `source_directories` suggestion, you may want to check out some of the prior discussion on this ticket: https://projects.torsion.org/witten/borgmatic/issues/73 Could you say a little more about the issue with multiple configuration files? Is it just that you'd find yourself having to duplicate configuration among them?
Author

"Is it just that you’d find yourself having to duplicate configuration among them?"

Exactly :P

And thank you for all answers, very clear.

"Is it just that you’d find yourself having to duplicate configuration among them?" Exactly :P And thank you for all answers, very clear.
Owner

Thanks.. I think I understand the need now. I'll have to think through some of the options including the one you suggested. Feel free to add more ideas as well.

Thanks.. I think I understand the need now. I'll have to think through some of the options including the one you suggested. Feel free to add more ideas as well.
Author

Offtopic: Are you a teacher irl? you're so good at explaining stuff, for real, each time I asked here it was a pleasure to read the answer.

Offtopic: Are you a teacher irl? you're so good at explaining stuff, for real, each time I asked here it was a pleasure to read the answer.
Owner

Haha, thank you! No, I'm not a teacher. But as a software engineer, I often have to explain features/code to other engineers or stakeholders.

Haha, thank you! No, I'm not a teacher. But as a software engineer, I often have to explain features/code to other engineers or stakeholders.
Owner

With #148 implemented, you can now share common configuration between multiple separate configuration files. So for instance, let's say that you create two separate configuration files, each one to backup a different repository with different source directories. Then, assuming that you have common config options that you want to share across those config files, you can use the new include feature to pull in shared configuration options.

See #148 and this documentation for details.

With #148 implemented, you can now share common configuration between multiple separate configuration files. So for instance, let's say that you create two separate configuration files, each one to backup a different repository with different source directories. Then, assuming that you have common config options that you want to share across those config files, you can use the new include feature to pull in shared configuration options. See #148 and [this documentation](https://torsion.org/borgmatic/docs/how-to/make-per-application-backups/#configuration-includes) for details.
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: borgmatic-collective/borgmatic#118
No description provided.