borgbase / ansible-role-borgbackup

Ansible role to set up Borg and Borgmatic
MIT License
221 stars 98 forks source link

Allow customization of `archive_name_format` and include `match_archives` #123

Open agross opened 1 year ago

agross commented 1 year ago

I mostly use files in /etc/borgmatic.d that inherit from /etc/borgmatic/config.yaml. Those inherited configs share the {hostname} prefix of the hard-coded archive_name_format but append an application-specific token.

Default config: host-<timestamp> App1 config: host-app1-<timestamp> App2 config: host-app2-<timestamp>

One issue I see is that when the default config is run (I run all of those configs at night) it starts pruning data from App1 and App2, but according to retention rules of the default config.

I think this is because borgmatic considers the timestamp part of host-<timestamp> to be ephemeral and matches all host-* archives, including e.g. host-app1-*.