Can't run archives check when max_duration is set, even with --only archives #988

Closed
opened 2025-02-04 06:42:18 +00:00 by qrhfz · 5 comments

What I'm trying to do and why

I have a quite big repo in an HDD. I set max duration to limit repository check duration so i can do hourly backup. But, i still want to do daily archives check.

Steps to reproduce

Given a repository at: /run/media/q/wd-blue-4tb/content

And a config file at ~/.config/borgmatic.d/999-reproduce-steps.yaml with the following content:

repositories:
    - path: /run/media/q/wd-blue-4tb/content

skip_actions:
  - create
  - prune
  - compact

checks:
    - name: repository
      max_duration: 10
    - name: archives
      frequency: 1 day

Run

borgmatic -v2  --only archives -c .config/borgmatic.d/999-reproduce-steps.yaml

Actual behavior

/home/q/.config/borgmatic.d/999-reproduce-steps.yaml: No commands to run for pre-everything hook
/home/q/.config/borgmatic.d/999-reproduce-steps.yaml: Skipping create/prune/compact actions due to configured skip_actions
BORG_RELOCATED_REPO_ACCESS_IS_OK=*** BORG_UNKNOWN_UNENCRYPTED_REPO_ACCESS_IS_OK=*** BORG_EXIT_CODES=*** borg --version --debug --show-rc
/home/q/.config/borgmatic.d/999-reproduce-steps.yaml: Borg 1.4.0
/run/media/q/wd-blue-4tb/content: Running actions for repository
/home/q/.config/borgmatic.d/999-reproduce-steps.yaml: No commands to run for pre-actions hook
/home/q/.config/borgmatic.d/999-reproduce-steps.yaml: No commands to run for pre-check hook
/run/media/q/wd-blue-4tb/content: Running consistency checks
BORG_RELOCATED_REPO_ACCESS_IS_OK=*** BORG_UNKNOWN_UNENCRYPTED_REPO_ACCESS_IS_OK=*** BORG_EXIT_CODES=*** borg info --json /run/media/q/wd-blue-4tb/content
Reading check time from /home/q/.local/state/borgmatic/checks/a3d3a526120721ffb75450a3e3e7718734369389d2605fd78814f145fa57b070/archives/5b39eb3d2ace2c2200255dd92f1565be627b366f3fa7f32ee9113f7fd548afc6
Reading check time from /home/q/.local/state/borgmatic/checks/a3d3a526120721ffb75450a3e3e7718734369389d2605fd78814f145fa57b070/archives/all
/run/media/q/wd-blue-4tb/content: Error running actions for repository
The archives check cannot run when the repository check has the max_duration option set
/home/q/.config/borgmatic.d/999-reproduce-steps.yaml: No commands to run for on-error hook
/home/q/.config/borgmatic.d/999-reproduce-steps.yaml: An error occurred
/home/q/.config/borgmatic.d/999-reproduce-steps.yaml: No commands to run for post-everything hook

summary:
/home/q/.config/borgmatic.d/999-reproduce-steps.yaml: Loading configuration file
/home/q/.config/borgmatic.d/999-reproduce-steps.yaml: An error occurred
/run/media/q/wd-blue-4tb/content: Error running actions for repository
The archives check cannot run when the repository check has the max_duration option set

Need some help? https://torsion.org/borgmatic/#issues

Expected behavior

Given that max_duration is only applicable to repository check. Borgmatic should ignore max_duration when '--only archives' is set. Even better if Borgmatic could be smart enough to sepearate repository check from other checks when max_duration is set.

Other notes / implementation ideas

No response

borgmatic version

1.9.8

borgmatic installation method

pipx

Borg version

borg 1.4.0

Python version

No response

Database version (if applicable)

Python 3.13.1

Operating system and version

Arch Linux

### What I'm trying to do and why I have a quite big repo in an HDD. I set max duration to limit repository check duration so i can do hourly backup. But, i still want to do daily archives check. ### Steps to reproduce Given a repository at: `/run/media/q/wd-blue-4tb/content` And a config file at `~/.config/borgmatic.d/999-reproduce-steps.yaml` with the following content: ``` repositories: - path: /run/media/q/wd-blue-4tb/content skip_actions: - create - prune - compact checks: - name: repository max_duration: 10 - name: archives frequency: 1 day ``` Run ``` borgmatic -v2 --only archives -c .config/borgmatic.d/999-reproduce-steps.yaml ``` ### Actual behavior ``` /home/q/.config/borgmatic.d/999-reproduce-steps.yaml: No commands to run for pre-everything hook /home/q/.config/borgmatic.d/999-reproduce-steps.yaml: Skipping create/prune/compact actions due to configured skip_actions BORG_RELOCATED_REPO_ACCESS_IS_OK=*** BORG_UNKNOWN_UNENCRYPTED_REPO_ACCESS_IS_OK=*** BORG_EXIT_CODES=*** borg --version --debug --show-rc /home/q/.config/borgmatic.d/999-reproduce-steps.yaml: Borg 1.4.0 /run/media/q/wd-blue-4tb/content: Running actions for repository /home/q/.config/borgmatic.d/999-reproduce-steps.yaml: No commands to run for pre-actions hook /home/q/.config/borgmatic.d/999-reproduce-steps.yaml: No commands to run for pre-check hook /run/media/q/wd-blue-4tb/content: Running consistency checks BORG_RELOCATED_REPO_ACCESS_IS_OK=*** BORG_UNKNOWN_UNENCRYPTED_REPO_ACCESS_IS_OK=*** BORG_EXIT_CODES=*** borg info --json /run/media/q/wd-blue-4tb/content Reading check time from /home/q/.local/state/borgmatic/checks/a3d3a526120721ffb75450a3e3e7718734369389d2605fd78814f145fa57b070/archives/5b39eb3d2ace2c2200255dd92f1565be627b366f3fa7f32ee9113f7fd548afc6 Reading check time from /home/q/.local/state/borgmatic/checks/a3d3a526120721ffb75450a3e3e7718734369389d2605fd78814f145fa57b070/archives/all /run/media/q/wd-blue-4tb/content: Error running actions for repository The archives check cannot run when the repository check has the max_duration option set /home/q/.config/borgmatic.d/999-reproduce-steps.yaml: No commands to run for on-error hook /home/q/.config/borgmatic.d/999-reproduce-steps.yaml: An error occurred /home/q/.config/borgmatic.d/999-reproduce-steps.yaml: No commands to run for post-everything hook summary: /home/q/.config/borgmatic.d/999-reproduce-steps.yaml: Loading configuration file /home/q/.config/borgmatic.d/999-reproduce-steps.yaml: An error occurred /run/media/q/wd-blue-4tb/content: Error running actions for repository The archives check cannot run when the repository check has the max_duration option set Need some help? https://torsion.org/borgmatic/#issues ``` ### Expected behavior Given that max_duration is only applicable to repository check. Borgmatic should ignore `max_duration` when '--only archives' is set. Even better if Borgmatic could be smart enough to sepearate repository check from other checks when `max_duration` is set. ### Other notes / implementation ideas _No response_ ### borgmatic version 1.9.8 ### borgmatic installation method pipx ### Borg version borg 1.4.0 ### Python version _No response_ ### Database version (if applicable) Python 3.13.1 ### Operating system and version Arch Linux
Owner

Thanks for filing this! Seems reasonable to me.. (Either one of those approaches you described.)

Thanks for filing this! Seems reasonable to me.. (Either one of those approaches you described.)
Owner

Okay, this is implemented in main and will be part of the next release! I went with your idea of making borgmatic smart enough to run archives and repository checks independently when a max duration is set (via option or CLI flag). Thanks again!

Okay, this is implemented in main and will be part of the next release! I went with your idea of making borgmatic smart enough to run archives and repository checks independently when a max duration is set (via option or CLI flag). Thanks again!
Owner

Released in borgmatic 1.9.10!

Released in borgmatic 1.9.10!
Author

Released in borgmatic 1.9.10!

Thank you. It works perfectly.

> Released in borgmatic 1.9.10! Thank you. It works perfectly.
Owner

Awesome, glad to hear it!

Awesome, glad to hear it!
Sign in to join this conversation.
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: borgmatic-collective/borgmatic#988
No description provided.