How to catch warnings for files that are not backed up? #733

Closed
opened 2023-07-28 17:37:56 +00:00 by shukon · 2 comments

What I'm trying to do and why

I just checked the health of my backups and noticed that there are files not being backed up - some due to being sqlite databases I didn't know about that changed, some due to permission errors.
However, Borgs return code is 1 for warning. And borgmatic only considers return codes of > 2 errors, because return code 1 is "just a warning". Now this was changed for the borg check. But not for borg create.
I would basically like my healthcheck to fail, if some files failed to back up. Otherwise I need to start monitoring borgmatic logs for warnings, because I'd like to know about issues during backups.
Possibly I'm thinking this all wrong, since I couldn't find any other issues about this. But I cannot wrap my head around the fact that files not being backed up is still considered a successful backup.
Thanks for the amazing piece of software ❤️

### What I'm trying to do and why I just checked the health of my backups and noticed that there are files not being backed up - some due to being sqlite databases I didn't know about that changed, some due to permission errors. However, [Borgs return code](https://borgbackup.readthedocs.io/en/stable/usage/general.html#return-codes) is 1 for warning. And borgmatic only considers [return codes of > 2 errors](https://github.com/borgmatic-collective/borgmatic/blob/c11dcdef0addd852c030bc713689802d88dd6cae/borgmatic/execute.py#L11), because return code 1 is "just a warning". Now this was [changed](https://projects.torsion.org/borgmatic-collective/borgmatic/issues/247#issuecomment-2159) for the `borg check`. But not for `borg create`. I would basically like my healthcheck to fail, if some files failed to back up. Otherwise I need to start monitoring borgmatic logs for warnings, because I'd like to know about issues during backups. Possibly I'm thinking this all wrong, since I couldn't find any other issues about this. But I cannot wrap my head around the fact that files not being backed up is still considered a successful backup. Thanks for the amazing piece of software :heart:
Owner

Thanks for taking the time to file this! However I do think it's a duplicate of #709. The existing "source_directories_must_exist" option will cause borgmatic to fail if a source directory is missing, but it won't do anything if there's a permission error on some other file within a source directory. Anyway, I recommend closing this in favor of #709 and then following along with the issue there (and adding any additional thoughts you may have).

Related: borgmatic does have a SQLite hook integration, so you may be able to use that instead of hitting permissions errors on in-use SQLite files.

Thanks for taking the time to file this! However I do think it's a duplicate of #709. The existing "source_directories_must_exist" option will cause borgmatic to fail if a source directory is missing, but it won't do anything if there's a permission error on some other file _within_ a source directory. Anyway, I recommend closing this in favor of #709 and then following along with the issue there (and adding any additional thoughts you may have). Related: borgmatic does have a SQLite hook integration, so you may be able to use that instead of hitting permissions errors on in-use SQLite files.
Author

Thanks a lot for the quick reply and the hint to #709 - I somehow missed it, probably bad search terms. Sorry.

(also thanks for the SQLite hook note - I usually use it, this was more about general backup healthchecks for all sorts of things)

Thanks a lot for the quick reply and the hint to #709 - I somehow missed it, probably bad search terms. Sorry. (also thanks for the SQLite hook note - I usually use it, this was more about general backup healthchecks for all sorts of things)
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#733
No description provided.