mirror of
https://github.com/roles-ansible/ansible_role_restic_archiver.git
synced 2024-08-16 10:09:49 +02:00
improve restic pruning
This commit is contained in:
parent
bc40bf7e6e
commit
3ddad038c4
2 changed files with 10 additions and 1 deletions
|
@ -107,6 +107,11 @@ restic {{ restic_archiver__default_opt }} stats latest | grep Total
|
|||
|
||||
echo "init $BACKUP_NAME"
|
||||
restic {{ restic_archiver__default_opt }} forget {{ retention_pattern(repo) }}
|
||||
echo "restic forget done"
|
||||
{%- if repo.prune|default(restic_archiver__prune) %}
|
||||
restic {{ restic_archiver__default_opt }} prune
|
||||
echo "restic prune done"
|
||||
{% endif %}
|
||||
|
||||
{% if restic_archiver__mail_report | default(false) %}
|
||||
cat <<EOT >> /tmp/mailcontent
|
||||
|
@ -186,6 +191,10 @@ export RESTIC_PASSWORD='{{ repo['archive_password'] | regex_replace('\'', '\'\\\
|
|||
BACKUP_NAME="{{ repo.name }}_archive"
|
||||
|
||||
restic {{ restic_archiver__default_opt }} forget {{ retention_pattern(repo) }}
|
||||
{%- if repo.prune|default(restic_archiver__prune) %}
|
||||
restic {{ restic_archiver__default_opt }} prune
|
||||
echo "restic ARCHIVE prune done"
|
||||
{% endif %}
|
||||
|
||||
{% endif %}
|
||||
{% if restic_archiver__mail_report | default(false) %}
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
---
|
||||
playbook_version_number: 45 # should be int
|
||||
playbook_version_number: 46 # should be int
|
||||
playbook_version_path: 'role-restic_archiver_roles-ansible_github.com.version'
|
||||
|
|
Loading…
Reference in a new issue