Skip to content
This repository has been archived by the owner on Jun 12, 2020. It is now read-only.

Commit

Permalink
Merge pull request #16 from kaleng/feature_restic_check
Browse files Browse the repository at this point in the history
make "restic check" execution configurable
  • Loading branch information
paulfantom authored May 14, 2018
2 parents 8916ad8 + 1c6537d commit ff639e8
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions templates/restic.cron.j2
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,21 @@ RESTIC_PASSWORD="{{ item.password }}"
{% endfor %}
{% endif %}

# Apply retention policy (if specified) and check repository
{{ item.retention_time | default('17 3 * * *') }} {{ restic_user }}{% if item.retention is defined %} restic forget --prune
{% if item.retention is defined -%}
# Apply retention policy
{{ item.retention_time | default('17 3 * * *') }} {{ restic_user }} restic forget --prune
{%- if item.retention.last is defined %} --keep-last {{ item.retention.last }}{% endif -%}
{% if item.retention.hourly is defined %} --keep-hourly {{ item.retention.hourly }}{% endif -%}
{% if item.retention.daily is defined %} --keep-daily {{ item.retention.daily }}{% endif -%}
{% if item.retention.weekly is defined %} --keep-weekly {{ item.retention.weekly }}{% endif -%}
{% if item.retention.monthly is defined %} --keep-monthly {{ item.retention.monthly }}{% endif -%}
{% if item.retention.yearly is defined %} --keep-yearly {{ item.retention.yearly }}{% endif -%}
{% if item.retention.tags is defined %} --keep-tag {% for tag in item.retention.tags %}{{ tag }}{% if not loop.last %},{% endif %}{% endfor %}{% endif -%}
;{% endif %} restic check
;{% endif %}
{% if item.check | default(true) -%}
# Check repository
{{ item.check_time | default('17 4 * * *') }} {{ restic_user }} restic check
{%- endif %}

# Do an actual backup
{% for job in item.jobs %}
Expand Down

0 comments on commit ff639e8

Please sign in to comment.