[Borgbackup] Borgbackup] Retrieve the status (return code) of a backup?

Frédéric PAVY frederic.pavy at free.fr
Thu Mar 26 19:03:11 EDT 2020


Hi all,

> Le 26 mars 2020 à 17:00, borgbackup-request at python.org a écrit :
> 
> On 26.03.20 16:10, Bzzzz wrote:
>> On Thu, 26 Mar 2020 16:01:32 +0100
>> Mario Emmenlauer <mario at emmenlauer.de <mailto:mario at emmenlauer.de>> wrote:
>>> On 26.03.20 15:35, Bzzzz wrote:
>>>> On Thu, 26 Mar 2020 12:02:33 +0100 (CET)
>>>> Fr?d?ric PAVY <frederic.pavy at free.fr <mailto:frederic.pavy at free.fr>> wrote:
>>>>> I do borg backups automatically, silently, and recently I discovered
>>>>> that some backups returned in error (return code 1).
>>>>> 
>>>>> I launched 'borg list' for the repository and even 'borg info' for
>>>>> an individual archive and was surprised not to see the return code
>>>>> for the 'borg create' corresponding command. Where could I retrieve
>>>>> this information? Isn't it stored in the backup? If not, could I
>>>>> understand the reason?
>>>> 
>>>> You can retrieve the system exit code of any executable into bash
>>>> with $?
>>>> 
>>>> ie :	ls ; echo $?
>>> 
>>> I think he is talking about where to get this status after the fact,
>>> like days or weeks after the creation of the archive. Fr?d?ric PAVY
>>> is that correct?
>> 
>> Oh, ok, but in this case (never had that), I suppose the command will
>> fail explaining by itself what was wrong?
> 
> I may be completely on the wrong track, but I understood the question
> still different. I think he created many repos, a longer time ago. And
> some of these creations failed.
> 
> Now its long after the fact, but he is presented with the list of repo
> directories. And he's wondering which of these repos are trustworthy,
> in the sense that their creation was completed successfully. Is there
> some property that would ensure that a repo creation was completed all
> the way to the end, successfully?
> 
> Fr?d?ric PAVY, is that your question?
> 
> Cheers,
> 
>    Mario

Yes, you’re right!

Here is my configuration… I have some Raspberry pi, each for one function (octopi, retropie, …).
I have automated their backup with Borg on another pi, always on and with a big disk (this one runs nextcloudPi too). I didn’t verify the backup process (I confess). Sometimes I watched the repositories and seeing that there are always new backups in the repository gave me the illusion that all was OK.

When I had a problem on one machine, I wasn’t able to restore the pi correctly, and after having recreated entirely the machine, I realised that the backup wasn’t complete, some files couldn’t be saved, and the backup ended with a return code of 1.

I think it could be useful to have the information of the return code, for example in the 'borg list /path/to/repository’ command.

But 	anyway, I will improve my script, and I thing I’ll log borg’s return code after each backup, and append the log to a file on the drive containing the repository, to have a vision of this  backups

Cheers,
Frederic
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/borgbackup/attachments/20200327/129621bb/attachment.html>


More information about the Borgbackup mailing list