Is --max-duration for checks supported by YAML already? #506

Open
opened 2022-03-07 10:01:40 +00:00 by ams_tschoening · 7 comments

What I'm trying to do and why

I'm running repo checks by default using repository and archives, because those checks seemed to have fit pretty well into my backup time window in the past. Though, some days ago this wasn't the case anymore and checking operations which according to former logs took only e.g. 5 minutes, required around 45 minutes now.

Of course this doesn't have anything to do with BORG or BORGMATIC, but instead I'm backing up to some NAS-like device provided by my hoster. The provider doesn't guarantee any performance and most likely changed/did something for some reason, resulting in temporarily bad performance. Things seem to be better now.

The point is, that while I would like to have as much checks as possible, backing up the individual data of all systems is more important of course. Because multiple backups are run one after another only when the former has finished, exceptionally long running checks make things difficult.

That's where --max-duration comes into play, even though it supports slightly different checks only. Though, I can't see --max-duration in the YAML structure for consistency.

So, is it supported already and I need to upgrade BORGMATIC or isn't it supported currently and I need to use it in extra_borg_options/check instead? In the latter case, would you consider supporting it for consistency?

Thanks!

Environment

borgmatic version: 1.5.15
borgmatic installation method: PIP, system wide
Borg version: 1.1.16
Python version: 3.8.10
operating system and version: Ubuntu 20.04

#### What I'm trying to do and why I'm running repo checks by default using `repository` and `archives`, because those checks seemed to have fit pretty well into my backup time window in the past. Though, some days ago this wasn't the case anymore and checking operations which according to former logs took only e.g. 5 minutes, required around 45 minutes now. Of course this doesn't have anything to do with BORG or BORGMATIC, but instead I'm backing up to some NAS-like device provided by my hoster. The provider doesn't guarantee any performance and most likely changed/did something for some reason, resulting in temporarily bad performance. Things seem to be better now. The point is, that while I would like to have as much checks as possible, backing up the individual data of all systems is more important of course. Because multiple backups are run one after another only when the former has finished, exceptionally long running checks make things difficult. That's where [--max-duration](https://borgbackup.readthedocs.io/en/stable/usage/check.html?highlight=check) comes into play, even though it supports slightly different checks only. Though, I can't see `--max-duration` in the YAML structure for `consistency`. So, is it supported already and I need to upgrade BORGMATIC or isn't it supported currently and I need to use it in `extra_borg_options/check` instead? In the latter case, would you consider supporting it for `consistency`? Thanks! #### Environment **borgmatic version:** 1.5.15 **borgmatic installation method:** PIP, system wide **Borg version:** 1.1.16 **Python version:** 3.8.10 **operating system and version:** Ubuntu 20.04
Owner

It's supported by borgmatic, but currently it's only at the command-line level rather than the configuration level. E.g., you can do borgmatic check --max-duration. I think your idea of adding it as an option to the consistency section of borgmatic's configuration file makes sense as well! (Implementation note: If max duration is specified in both the configuration file and on the command-line, the command-line value should take precedence.) In the meantime, you can use the command-line work-around. Thanks for filing this!

It's supported by borgmatic, but currently it's only at the command-line level rather than the configuration level. E.g., you can do `borgmatic check --max-duration`. I think your idea of adding it as an option to the `consistency` section of borgmatic's configuration file makes sense as well! (Implementation note: If max duration is specified in both the configuration file and on the command-line, the command-line value should take precedence.) In the meantime, you can use the command-line work-around. Thanks for filing this!
witten added the
design finalized
label 2022-03-08 05:59:46 +00:00

Hi, thanks for your great work. I just wanted to report that this does not seem to work for me with borg 1.2.0 and borgmatic 1.5.24. Is it on another branch?

/root/.local/bin/borgmatic check --verbosity 2 --syslog-verbosity 2 --max-duration=3600

Also, I think it would be very nice to have this in the config file as you were saying as I have a big repository and checking over SSH in a stable way becomes tricky as connection needs to be maintained for more than 20 hours.

Hi, thanks for your great work. I just wanted to report that this does not seem to work for me with borg 1.2.0 and borgmatic 1.5.24. Is it on another branch? `/root/.local/bin/borgmatic check --verbosity 2 --syslog-verbosity 2 --max-duration=3600` Also, I think it would be very nice to have this in the config file as you were saying as I have a big repository and checking over SSH in a stable way becomes tricky as connection needs to be maintained for more than 20 hours.
Owner

My mistake. For some reason I thought it was already implemented as a command-line flag! Looks like it's not. Agreed that it would make sense in the config file instead! As an interim as a work-around, you could add it to check under the extra_borg_options in the configuration file. Example:

storage:
    extra_borg_options:
        check: --max-duration=3600
My mistake. For some reason I thought it was already implemented as a command-line flag! Looks like it's not. Agreed that it would make sense in the config file instead! As an interim as a work-around, you could add it to `check` under the `extra_borg_options` in the configuration file. Example: ```yaml storage: extra_borg_options: check: --max-duration=3600 ```

Many thanks for the help @witten. It actually works, as the option is correctly present in the command line but (because of borg) it needs to set a lot other very specific options: it needs --repository-only and this in turn is not compatible with --first, --last, --prefix and --verify-data arguments . So in short, I think this would require a dedicated command for the time being (outside of borgmatic). There seems not to be an easy solution to do repository and archives checks together as repository check can have --max-duration but archive check cannot.

Mind that the correct option is --max-duration, just for reference.

Many thanks again for the quick and nice help.

Many thanks for the help @witten. It actually works, as the option is correctly present in the command line but (because of borg) it needs to set a lot other very specific options: it needs `--repository-only` and this in turn is not compatible with `--first`, `--last`, `--prefix` and `--verify-data` arguments . So in short, I think this would require a dedicated command for the time being (outside of borgmatic). There seems not to be an easy solution to do repository and archives checks together as repository check can have `--max-duration` but archive check cannot. Mind that the correct option is `--max-duration`, just for reference. Many thanks again for the quick and nice help.

PS: Of course you can do it in two steps in borgmatic and include the option only in the repository check.

PS: Of course you can do it in two steps in borgmatic and include the option only in the repository check.
Owner

Thanks for pointing this out. Certainly seems like a candidate for a borgmatic option then.. borgmatic could apply the logic to add --max-duration only when --repository-only is implied.. or just to error if that's not the case.

Thanks for pointing this out. Certainly seems like a candidate for a borgmatic option then.. borgmatic could apply the logic to add `--max-duration` only when `--repository-only` is implied.. or just to error if that's not the case.
Owner

While there's no --max-duration support yet, you may be interested in the related ticket #523, which allows you to run checks at a configured frequency rather than running them all the time. The documentation for that (not yet released) feature is here: https://torsion.org/borgmatic/docs/how-to/deal-with-very-large-backups/#check-frequency

While there's no `--max-duration` support yet, you may be interested in the related ticket #523, which allows you to run checks at a configured frequency rather than running them all the time. The documentation for that (not yet released) feature is here: https://torsion.org/borgmatic/docs/how-to/deal-with-very-large-backups/#check-frequency
Sign in to join this conversation.
No Milestone
No Assignees
3 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#506
No description provided.