[Borgbackup] Can different error codes of individual files be mapped to different results?

Thorsten Schöning tschoening at am-soft.de
Wed Sep 8 09:15:45 EDT 2021


Guten Tag Thomas Waldmann,
am Mittwoch, 8. September 2021 um 12:33 schrieben Sie:

>> That doesn't help anything in context of e.g. using BorgMatic,
> Well, then use the other alternatives I gave.

Your arguments are mostly missing the point, it's neither about
temporary directories, snapshots are already used etc. It's only about
whoever is interested in BORG's overall result code.

The only alternatives are lettings others look into BORG's logs, but
that requires one to log those files and their results, one needs to
parse possibly large text files etc. Would be easier and more
efficient if BORG could handle that on its won already.

https://projects.torsion.org/witten/borgmatic/issues/447

> It can't do that automagically and configuring that per-file would
> be way too tedious.

BORG doesn't need and even shouldn't decide automagically. We only
need to find an easy way to map errors of individual files to the one
and only overall result code.

In the easiest case one doesn't need configs per file, but is only
interested in if any error (like missing file) happened at all. So
whenever BORG detects an error during backup of some file, it decides
based on that error code if the overall result might be an error as
well. The error code per file is available aready, as it is logged and
mapped to letter "E". So an additional switch to provide error codes
for individual files to be handled as error instead of a warning might
be enough already.

> borg create --file-result-is-error always|2|5|...

In the long term, this can be expanded with file paths, multiple
provided error codes etc. using regular expressions. Simply like
"--exclude", "--exclude-from" etc. work already.

> borg create --file-result-is-error-from

The underlying file format could e.g. simply be some space separated
map of result codes mapped to paths. This file would answer the
following questions: If the error code of the current file is "..."
and if the current file matches "...", consider the overall result to
be an error.

> 2 /mnt/.+/root/vmlinuz.old
> 5 /mnt/.+/root/some_file.txt

With an additional column this could even be enhanced further to be a
concrete overall result code like 25 instead of the default 2, it
could be forcefully mapped to be a warning with result code 1 only
etc. This would only be needed for files with errors, which in theory
are less, and would be much faster and safer than parsing logs.

Mit freundlichen Grüßen

Thorsten Schöning

-- 
AM-SoFT IT-Service - Bitstore Hameln GmbH
Mitglied der Bitstore Gruppe - Ihr Full-Service-Dienstleister für IT und TK

E-Mail: Thorsten.Schoening at AM-SoFT.de
Web:    http://www.AM-SoFT.de/

Tel:   05151-  9468- 0
Tel:   05151-  9468-55
Fax:   05151-  9468-88
Mobil:  0178-8 9468-04

AM-SoFT IT-Service - Bitstore Hameln GmbH, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 221853 - Geschäftsführer: Janine Galonska






More information about the Borgbackup mailing list