diff --git a/README.md b/README.md index ae15e9b..223870c 100644 --- a/README.md +++ b/README.md @@ -95,6 +95,8 @@ $ git clone https://github.com/borgbase/ansible-role-borgbackup.git roles/ansibl - `borg_pip_packages`: Dependancy Packages (pip) to install `borg(backup)` and `borgmatic`. - `borg_remote_path`: Path to the borg executable on the remote. It will default to `borg`. - `borg_remote_rate_limit`: Remote network upload rate limit in kiBytes/second. +- `borgmatic_retries`: Number of times to retry a failing backup before giving up. Defaults to 0 (i.e., does not attempt retry). +- `borgmatic_retry_wait`: Wait time between retries (in seconds) to allow transient issues to pass. Increases after each retry as a form of backoff. Defaults to 0 (no wait). - `borg_retention_policy`: Retention policy for how many backups to keep in each category (daily, weekly, monthly, etc). - `borg_source_directories`: List of local folders to back up. Default is `/etc/hostname` to prevent an empty backup. - `borg_ssh_key_name`: Name of the SSH public and pivate key. Default `id_ed25519` diff --git a/meta/argument_specs.yml b/meta/argument_specs.yml index e074e45..9eb51fe 100644 --- a/meta/argument_specs.yml +++ b/meta/argument_specs.yml @@ -102,6 +102,18 @@ argument_specs: type: int required: false description: Remote network upload rate limit in kiBytes/second. + borgmatic_retries: + type: int + required: false + description: | + Number of times to retry a failing backup before giving up. + Defaults to 0 (i.e., does not attempt retry). + borgmatic_retry_wait: + type: int + required: false + description: | + Wait time between retries (in seconds) to allow transient issues to pass. + Increases after each retry as a form of backoff. Defaults to 0 (no wait). borg_ssh_key_file_path: type: str required: false diff --git a/templates/config.yaml.j2 b/templates/config.yaml.j2 index 6c6abd0..65f96aa 100644 --- a/templates/config.yaml.j2 +++ b/templates/config.yaml.j2 @@ -88,6 +88,19 @@ compression: {{ borg_compression|default('auto,zstd') }} upload_rate_limit: {{ borg_remote_rate_limit }} {% endif %} +# Number of times to retry a failing backup before giving up. +# Defaults to 0 (i.e., does not attempt retry). +{% if borgmatic_retries is defined %} +retries: {{ borgmatic_retries }} +{% endif %} + +# Wait time between retries (in seconds) to allow transient +# issues to pass. Increases after each retry as a form of +# backoff. Defaults to 0 (no wait). +{% if borgmatic_retry_wait is defined %} +retry_wait: {{ borgmatic_retry_wait }} +{% endif %} + # Command to use instead of just "ssh". This can be used to specify ssh options. # ssh_command: ssh -i ~/.ssh/id_ed25519 {% if borg_ssh_command %} diff --git a/templates/config_1.7.yaml.j2 b/templates/config_1.7.yaml.j2 index 54af4c9..4193c7e 100644 --- a/templates/config_1.7.yaml.j2 +++ b/templates/config_1.7.yaml.j2 @@ -89,6 +89,19 @@ storage: remote_rate_limit: {{ borg_remote_rate_limit }} {% endif %} + # Number of times to retry a failing backup before giving up. + # Defaults to 0 (i.e., does not attempt retry). +{% if borgmatic_retries is defined %} + retries: {{ borgmatic_retries }} +{% endif %} + + # Wait time between retries (in seconds) to allow transient + # issues to pass. Increases after each retry as a form of + # backoff. Defaults to 0 (no wait). +{% if borgmatic_retry_wait is defined %} + retry_wait: {{ borgmatic_retry_wait }} +{% endif %} + # Command to use instead of just "ssh". This can be used to specify ssh options. # ssh_command: ssh -i ~/.ssh/id_ed25519 {% if borg_ssh_command %}