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

Run check-before/check-after only once per repository #311

Open
lukasbestle opened this issue Feb 10, 2024 · 1 comment
Open

Run check-before/check-after only once per repository #311

lukasbestle opened this issue Feb 10, 2024 · 1 comment

Comments

@lukasbestle
Copy link

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.

@creativeprojects
Copy link
Owner

creativeprojects commented Feb 10, 2024

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 👍🏻

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

No branches or pull requests

2 participants