1
0
Fork 0
mirror of https://github.com/roles-ansible/ansible_role_restic_archiver.git synced 2024-08-16 10:09:49 +02:00

add restic verify to script

This commit is contained in:
Lilian Roller 2020-12-14 10:26:29 +01:00
parent 933e8c0bbb
commit 2e0a88aa8b
No known key found for this signature in database
GPG key ID: 5215C3441797AB2B

View file

@ -48,14 +48,14 @@ set -euxo pipefail
--prune {% endif %} --prune {% endif %}
{%- endmacro %} {%- endmacro %}
# Settings for Server {{ repo['name'] | string }} # Settings for Server {{ repo['name'] | string }}
export RESTIC_REPOSITORY="{{ repo['location'] }}" export RESTIC_REPOSITORY="{{ repo['location'] }}"
export RESTIC_PASSWORD='{{ repo['password'] | regex_replace('\'', '\'\\\'\'') }}' export RESTIC_PASSWORD='{{ repo['password'] | regex_replace('\'', '\'\\\'\'') }}'
BACKUP_NAME="{{ repo.name }}" BACKUP_NAME="{{ repo.name }}"
{{ restic_install_path }}/restic forget {{ retention_pattern(repo) }} restic forget {{ retention_pattern(repo) }}
restic check
{% if repo.archive|default(false) %} {% if repo.archive|default(false) %}
# ARCHIVE Settings for Server "{{ repo['name'] | string }}" # ARCHIVE Settings for Server "{{ repo['name'] | string }}"
@ -79,18 +79,18 @@ export RESTIC_PASSWORD='{{ repo['password'] | regex_replace('\'', '\'\\\'\'') }}
# transfer snapshots to archive # transfer snapshots to archive
restic copy restic copy
{% if repo.archive_cleanup | default(false) %} {% if repo.archive_cleanup %}
# ARCHIVE CLEANUP Settings for Server "{{ repo['name'] | string }}"
export RESTIC_REPOSITORY="{{ repo['archive_location'] }}"
export RESTIC_PASSWORD='{{ repo['archive_password'] | regex_replace('\'', '\'\\\'\'') }}'
BACKUP_NAME="{{ repo.name }}_archive"
restic forget {{ retention_pattern(repo) }}
{{ restic_install_path }}/restic copy --copy-chunker-params
{% endif %} {% endif %}
restic check
{% endif %} {% endif %}
{% endfor %} {% endfor %}