Re: script to see if dar incremental backup recorded any changes

Denis Corbin <[email protected]>
Newsgroups gmane.comp.sysutils.backup.dar.support
Message-ID <[email protected]>
On 06/05/2021 00:56, imschmeg wrote:
> What is the most robust and fastest way to check if a dar incremental
> backup recorded any changes?

unless you find a bug, there is not a less robust way than an other to
perform a given action.

For the fastest way, yes, I cannot find any faster:

> 
> I could do:
> dar -l backup -q
> 
> and parse the output with awk to see if any of the lines "fully saved",
> "binary delta patch" or "inode metadata only" contain non-0 counts.
> And then also check the "N file(s) have been recorded as destroyed..."
> line.
> 
> This however seems a bit fragile, as it depends on the format of the
> summary staying the same.  Is there a better way?
> 

I agree, this is fragile, it also depends on the locale (messages can be
translated, depending on the value assigned to the LANG environment
variable: for example check this: "export LANG=fr_FR.utf8 ; dar -V"

If you don't want to parse the text output of a command outputting text,
but rather want structured information about the backup (integer values,
counters, and so on, in different fields), the best way is to directly
rely on the libdar API:

Today, you can make a simple program in C/C++ or in Python3.

For your use case, (obtaining just the number of saved files in an
existing backup) this is not much complicated to do

> 
>
OpenPGP_signature (application/pgp-signature, 840 B) - not displayed
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.