borgmatic list --successful omits certain non-checkpoint archives #224

Closed
opened 2019-10-16 16:49:59 +00:00 by witten · 2 comments
Owner

What I'm trying to do and why

Filter out checkpoint archives with borgmatic list --successful so as to only report on completed backups (e.g. for monitoring purposes).

Steps to reproduce / actual behavior

The existing implementation of --successful relies on a hacky glob match which doesn't work as expected. It excludes short archive names and those ending with a "t", even if they're not checkpoint archives.

See the discussion here: https://github.com/borgbackup/borg/issues/4047

Expected behavior

The --successful flag should only filter out checkpoint archives (those whose name ends with ".checkpoint", without excluding any other archives.

Other notes / implementation ideas

As noted in the linked ticket, the only possible approach right now is applying a checkpoint filter after Borg applies its own filters. This is a huge PITA because 1. Without the --json flag, borgmatic doesn't even consume Borg's output, and 2. Even with the --json flag, there's not a convenient place in the code right now to filter the output due to the way the results are yielded.

Environment

borgmatic version: 1.3.25

borgmatic installation method: pip install --user

Borg version: 1.1.10

Python version: 3.7.4

operating system and version: Manjaro Linux stable

#### What I'm trying to do and why Filter out checkpoint archives with `borgmatic list --successful` so as to only report on completed backups (e.g. for monitoring purposes). #### Steps to reproduce / actual behavior The existing implementation of `--successful` relies on a hacky glob match which doesn't work as expected. It excludes short archive names and those ending with a "t", even if they're not checkpoint archives. See the discussion here: https://github.com/borgbackup/borg/issues/4047 #### Expected behavior The `--successful` flag should only filter out checkpoint archives (those whose name ends with ".checkpoint", without excluding any other archives. #### Other notes / implementation ideas As noted in the linked ticket, the only possible approach right now is applying a checkpoint filter *after* Borg applies its own filters. This is a huge PITA because 1. Without the `--json` flag, borgmatic doesn't even consume Borg's output, and 2. Even with the `--json` flag, there's not a convenient place in the code right now to filter the output due to the way the results are `yield`ed. #### Environment **borgmatic version:** 1.3.25 **borgmatic installation method:** `pip install --user` **Borg version:** 1.1.10 **Python version:** 3.7.4 **operating system and version:** Manjaro Linux stable
witten added the
bug
label 2019-10-16 16:58:57 +00:00
Author
Owner

Well, not a great fix, but perhaps better than the original implementation:
c12c47cace

Here are the new docs for this:

borgmatic list includes support for a --successful flag that only lists
successful (non-checkpoint) backups. This flag works via a basic heuristic: It
assumes that non-checkpoint archive names end with a digit (e.g. from a
timestamp), while checkpoint archive names do not. This means that if you're
using custom archive names that do not end in a digit, the --successful flag
will not work as expected.

Well, not a great fix, but perhaps better than the original implementation: https://projects.torsion.org/witten/borgmatic/commit/c12c47caceb93bc1ee6a41e298887b0cb8de759b Here are the new docs for this: > `borgmatic list` includes support for a `--successful` flag that only lists successful (non-checkpoint) backups. This flag works via a basic heuristic: It assumes that non-checkpoint archive names end with a digit (e.g. from a timestamp), while checkpoint archive names do not. This means that if you're using custom archive names that do not end in a digit, the `--successful` flag will not work as expected.
Author
Owner

Fix released in 1.3.26.

Fix released in 1.3.26.
Sign in to join this conversation.
No Milestone
No Assignees
1 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#224
No description provided.