borgmatic-collective / docker-borgmatic

Borgmatic in Docker
GNU General Public License v3.0
313 stars 88 forks source link

"The checks option now expects a list of key/value pairs" warning & check frequency question #302

Closed televisi closed 4 months ago

televisi commented 4 months ago

I am currently using:

I've been using this config.yaml file for my backup, for some reason, post backup run, the following warning is displayed:

The checks option now expects a list of key/value pairs. 
Lists of strings for this option are deprecated and support will be removed from a future release.

The thing is, I'm not sure which config that I missed / will be deprecated, could someone please asisst? Thanks

source_directories:
    - /mnt/backups

repositories:
    - path: ssh://user@ssh:23/./backups
      label: backups

ssh_command: ssh -i /root/.ssh/privateKey

compression: lzma,9
archive_name_format: 'backups-{now:%Y-%m-%d_T_%H:%M:%S}'

checks:
    - repository
    - archives

check_last: 3

skip_actions: 
    - compact
    - prune
    - check

before_backup:
    - echo "Starting backup"

after_backup:
    - echo "Finished backup"

on_error:
    - echo "Error during create/prune/compact/check"

apprise:
    services:
        - url: pover://abc@def
          label: borg
    start:
        title: Start Backup!
        body: Starting backup process
    finish:
        title: Success Backup!
        body: Finished backup process
    fail:
        title: Failed Backup!
        body: Failed backup process
    states:
        - start
        - finish
        - fail

healthchecks:
    ping_url: https://hc-ping.com/123456
witten commented 4 months ago

The warning is due to this part of the configuration:

checks:
    - repository
    - archives

It should be changed as follows:

checks:
    - name: repository
    - name: archives

See the documentation for more information: https://torsion.org/borgmatic/docs/how-to/deal-with-very-large-backups/#consistency-check-configuration

televisi commented 4 months ago

Thank you! That was the bit that I was missing about!

Another question, on the configuration reference guide , there is an additional frequency that I can add it:

# checks:
    # Name of consistency check to run: "repository",
    # "archives", "data", and/or "extract". "repository"
    # checks the consistency of the repository, "archives"
    # checks all of the archives, "data" verifies the
    # integrity of the data within the archives, and "extract"
    # does an extraction dry-run of the most recent archive.
    # Note that "data" implies "archives". See "skip_actions"
    # for disabling checks altogether.
    # - name: repository

      # How frequently to run this type of consistency check (as
      # a best effort). The value is a number followed by a unit
      # of time. E.g., "2 weeks" to run this consistency check
      # no more than every two weeks for a given repository or
      # "1 month" to run it no more than monthly. Defaults to
      # "always": running this check every time checks are run.
      # frequency: 2 weeks

Let's say I wanted to run the repository check every 6 months, and archives every 3 months, which one should I use? I tried a couple of combinations below and none are accepted.

checks:
    - name: repository 6 months
    - name: archives 3 months

[2024-02-19 08:18:00,719] CRITICAL: /etc/borgmatic.d/backups.yaml: Error parsing configuration file                      
[2024-02-19 08:18:00,719] CRITICAL: An error occurred while parsing a configuration file at /etc/borgmatic.d/backups.yaml
At 'checks[0].name': 'repository 6 months' is not one of ['repository', 'archives', 'data', 'extract', 'disabled']       
At 'checks[1].name': 'archives 3 months' is not one of ['repository', 'archives', 'data', 'extract', 'disabled']         
checks:
    - name: repository, 6 months
    - name: archives, 3 months

[2024-02-19 08:24:00,318] CRITICAL: /etc/borgmatic.d/backups.yaml: Error parsing configuration file                      
[2024-02-19 08:24:00,318] CRITICAL: An error occurred while parsing a configuration file at /etc/borgmatic.d/backups.yaml
At 'checks[0].name': 'repository, 6 months' is not one of ['repository', 'archives', 'data', 'extract', 'disabled']      
At 'checks[1].name': 'archives, 3 months' is not one of ['repository', 'archives', 'data', 'extract', 'disabled']   
checks:
    - name: repository, '6 months'
    - name: archives, '3 months'

[2024-02-19 08:28:00,357] CRITICAL: An error occurred while parsing a configuration file at /etc/borgmatic.d/backups.yaml:
At 'checks[0].name': "repository, '6 months'" is not one of ['repository', 'archives', 'data', 'extract', 'disabled']
At 'checks[1].name': "archives, '3 months'" is not one of ['repository', 'archives', 'data', 'extract', 'disabled']

[2024-02-19 08:40:00,463] CRITICAL: An error occurred while parsing a configuration file at /etc/borgmatic.d/backups.yaml At 'checks[0].name': 'repository, 6 month' is not one of ['repository', 'archives', 'data', 'extract', 'disabled']
At 'checks[1].name': 'archives, 3 month' is not one of ['repository', 'archives', 'data', 'extract', 'disabled']


- Try 05

checks:

[2024-02-19 09:02:00,350] CRITICAL: An error occurred while parsing a configuration file at /etc/borgmatic.d/backups.yaml At 'checks[0].name': 'repository 6 month' is not one of ['repository', 'archives', 'data', 'extract', 'disabled']
At 'checks[1].name': 'archives 3 month' is not one of ['repository', 'archives', 'data', 'extract', 'disabled']



Thanks
witten commented 4 months ago

Close! But try this instead:

checks:
    - name: repository
      frequency: 6 months
    - name: archives
      frequency: 3 months

Also, in the future, you can file tickets about borgmatic directly here if they don't have anything to do with the Docker container: https://torsion.org/borgmatic/#issues

televisi commented 4 months ago

THANK YOU! Oh, wasn't aware that we are meant to use https://torsion.org/borgmatic/#issues; got confused between that one and this one.

But, got it now :)