Re: script to see if dar incremental backup recorded any changes
imschmeg <[email protected]>
| Newsgroups | gmane.comp.sysutils.backup.dar.support |
|---|---|
| Message-ID | <20210508192932.4ab401bd@lapdog> |
If I capture the output from dar incremental backup creation, is it accurate to determine whether the backup recorded any changes by examining the two lines: N inode(s) saved N inode(s) recorded as deleted from reference backup if either N>0, then the incremental backup recorded some changes, correct? Does this cover all cases, including deltas? This would be the fastest technique, obviously. On Thu, 6 May 2021 21:59:01 +0200 Denis Corbin <[email protected]> wrote: > 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 > > > > > >