resticprofile
resticprofile copied to clipboard
Run `check-before`/`check-after` only once per repository
My resticprofile configuration contains two profiles that use the same restic repository. The use case is to create separate snapshots of different directories so that one of the snapshots can be copied to another restic repository.
Both profiles use the check-after: true
option. When I run resticprofile backup
on each of the profiles, everything works as expected. But when I perform a backup on a group that contains both profiles, the checking is performed twice during the same run of resticprofile backup
. As the entire repository is checked anyway, this is not necessary. Each subsequent check of the same repository in the same backup run should be skipped automatically.
Hi,
Yes I see what you mean. This is something we can take into consideration when reviewing the version 2 of the configuration file format.
In the meantime it's easy to duplicate your profiles with inheritance, something like:
# configuration when running on its own
profile1:
backup:
source: /path1
# configuration when running on its own
profile2:
backup:
source: /path2
groups:
backup_group:
- profile1_in_group
- profile2_in_group
# configuration when running as part of the group
profile1_in_group:
inherit: profile1
check-before: true
check-after: false
# configuration when running as part of the group
profile2_in_group:
inherit: profile2
check-before: false
check-after: true
This example configuration would do a check before and after the group, but you get the idea 👍🏻