borg check fails with borgmatic and borg 1.1.2 #54

Closed
opened 2018-01-14 09:45:12 +00:00 by henfri · 4 comments

Hello,

when running borg check, this command is run for me:

borg check borg@openmediavault:/borgbackup --repository-only --archives-only --last 3 --remote-path borg

I get this output:

--repository-only contradicts --first, --last, --prefix and --verify-data arguments.

And borgmatic exits with returncode 2.
This makes sense, as "--repository-only" makes repository level checks only, while "--last" is an archive-level filter.

I do not know, what is needed in terms of check, but the intention of this command (checking the repository and the archive) today must either be splitted into two commands, or the --repository-only part must be removed.

Hello, when running borg check, this command is run for me: > borg check borg@openmediavault:/borgbackup --repository-only --archives-only --last 3 --remote-path borg I get this output: > --repository-only contradicts --first, --last, --prefix and --verify-data arguments. And borgmatic exits with returncode 2. This makes sense, as "--repository-only" makes repository level checks only, while "--last" is an archive-level filter. I do not know, what is needed in terms of check, but the intention of this command (checking the repository and the archive) today must either be splitted into two commands, or the --repository-only part must be removed.
Author

Hello,

I checked the code:

return tuple(
    '--{}-only'.format(check) for check in checks
    if check in DEFAULT_CHECKS
) + last_flag

This architecture might need a change. I do not know if borg will support both --archive-only and --repository-only at the same time in future (does not make sense to me).

I see two options here:
a) no last_flag if 'archive' is also checked
b) run borg check twice once for the archive, once for the repository

Hello, I checked the code: return tuple( '--{}-only'.format(check) for check in checks if check in DEFAULT_CHECKS ) + last_flag This architecture might need a change. I do not know if borg will support both --archive-only and --repository-only at the same time in future (does not make sense to me). I see two options here: a) no last_flag if 'archive' is also checked b) run borg check twice once for the archive, once for the repository
Owner

Yeah, you are correct in that the code as-is does not make sense. If both "archives" and "repository" are specified in borgmatic config, then neither --archive-only nor --repository-only should be passed to Borg. That's because Borg does both checks by default unless told otherwise. So this fix here is to omit the only flags in this case.

Yeah, you are correct in that the code as-is does not make sense. If both "archives" and "repository" are specified in borgmatic config, then neither `--archive-only` nor `--repository-only` should be passed to Borg. That's because Borg does both checks by default unless told otherwise. So this fix here is to omit the `only` flags in this case.
witten added the
bug
label 2018-01-14 22:08:43 +00:00
Owner

I just pushed a fix for this in master. The problem only manifested when you specified all three checks in borgmatic config. The fix will go out in the next borgmatic release. Thanks for reporting it!

I just pushed a fix for this in master. The problem only manifested when you specified all three checks in borgmatic config. The fix will go out in the next borgmatic release. Thanks for reporting it!
Owner

borgmatic 1.1.13 was just released with this fix.

borgmatic 1.1.13 was just released with this fix.
Sign in to join this conversation.
No Milestone
No Assignees
2 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#54
No description provided.