Automatically retry backups for n times #28

Closed
opened 2018-01-05 05:34:05 +00:00 by import_bot · 11 comments
Collaborator

To handle connection issues (such as SSH's "broken pipe", which you cannot always prevent) you might want to add an option to retry backups (for n times) when they fail.

This is what I've also explained here: https://github.com/borgbackup/borg/issues/636#issuecomment-257319412


Imported from Taiga issue 27 (to do). Created on 2016-10-31T15:55:36+0000 by rugk.

To handle connection issues (such as SSH's "broken pipe", which you cannot always prevent) you might want to add an option to retry backups (for n times) when they fail. This is what I've also explained here: https://github.com/borgbackup/borg/issues/636#issuecomment-257319412 --- Imported from Taiga issue 27 (to do). Created on 2016-10-31T15:55:36+0000 by rugk.
Contributor

This would be good. Any indication on how this could be setup in the schema?

https://projects.torsion.org/witten/borgmatic/src/branch/master/borgmatic/config/schema.yaml

Simply adding a "num_retry" somewhere around here? https://projects.torsion.org/witten/borgmatic/src/branch/master/borgmatic/config/schema.yaml#L129

This would be good. Any indication on how this could be setup in the schema? > https://projects.torsion.org/witten/borgmatic/src/branch/master/borgmatic/config/schema.yaml Simply adding a "num_retry" somewhere around here? https://projects.torsion.org/witten/borgmatic/src/branch/master/borgmatic/config/schema.yaml#L129
Owner

Yup, the storage section seems like the logical place, given precedent. I might just call it retries or retries_count though.

Variant idea: Make retrying some number of times the default behavior, and perhaps don't even make it configurable at all; just hard-coded. Rationale: Almost everyone probably wants retrying on, and anyone who really cares about when retries are happening can go spelunking in the logs.

Thoughts? I don't feel super strongly either way.

Yup, the `storage` section seems like the logical place, given precedent. I might just call it `retries` or `retries_count` though. Variant idea: Make retrying some number of times the default behavior, and perhaps don't even make it configurable at all; just hard-coded. Rationale: Almost everyone probably wants retrying on, and anyone who really cares about when retries are happening can go spelunking in the logs. Thoughts? I don't feel super strongly either way.

retries looks good to me.

`retries` looks good to me.

+1 to make it some number of retries the default, e.g. 3 sounds reasonable

+1 to make it some number of retries the default, e.g. 3 sounds reasonable
Owner

New retries and retry_wait options in the storage section of configuration should take care of this in the next release, courtesy of @cadamswaite. The default is zero retries, but I'm open to changing that.

New `retries` and `retry_wait` options in the `storage` section of configuration should take care of this in the next release, courtesy of @cadamswaite. The default is zero retries, but I'm open to changing that.
Owner

Just released in borgmatic 1.5.21!

Just released in borgmatic 1.5.21!

I'm running version 1.5.22 but I get these error messages when using retries and retry_wait:

/etc/borgmatic.d/drupal_site30002.yaml: Error parsing configuration file
An error occurred while parsing a configuration file at /etc/borgmatic.d/drupal_site30002.yaml:
Key 'retries' was not defined. Path: '/storage'
Key 'retry_wait' was not defined. Path: '/storage'

The config file looks like this:

storage:
    encryption_passphrase: 'something'
    retries: 1
    retry_wait: 300

What am I doing wrong?

I'm running version 1.5.22 but I get these error messages when using `retries` and `retry_wait`: ``` /etc/borgmatic.d/drupal_site30002.yaml: Error parsing configuration file An error occurred while parsing a configuration file at /etc/borgmatic.d/drupal_site30002.yaml: Key 'retries' was not defined. Path: '/storage' Key 'retry_wait' was not defined. Path: '/storage' ``` The config file looks like this: ``` storage: encryption_passphrase: 'something' retries: 1 retry_wait: 300 ``` What am I doing wrong?
Owner

That configuration looks correct to me! Can you confirm the version you're running? borgmatic --version should do it.

That configuration looks correct to me! Can you confirm the version you're running? `borgmatic --version` should do it.

Yes, it's 1.5.22

Yes, it's 1.5.22
Owner

In that case, can you try posting your entire (redacted) configuration file and I'll see if I can reproduce the problem? It might be easiest to open a new ticket for that.

In that case, can you try posting your entire (redacted) configuration file and I'll see if I can reproduce the problem? It might be easiest to open a new ticket for that.

@witten I'm very confused and sorry for the noice I've made here. I was just about to start a new issue and while collecting the details and retrying everything, it suddenly started to work without any issue. Although I'm having the error logs and a git repo with all the history for the config files, where nothing has changed since I added the retry settings, it failed yesterday and works correctly now. Performed a few more tests, but I can't explain what was going wrong. I keep monitoring this and get back to a new issue, when something similar should happen again.

@witten I'm very confused and sorry for the noice I've made here. I was just about to start a new issue and while collecting the details and retrying everything, it suddenly started to work without any issue. Although I'm having the error logs and a git repo with all the history for the config files, where nothing has changed since I added the retry settings, it failed yesterday and works correctly now. Performed a few more tests, but I can't explain what was going wrong. I keep monitoring this and get back to a new issue, when something similar should happen again.
Sign in to join this conversation.
No Milestone
No Assignees
6 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#28
No description provided.