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

make "restic check" execution configurable #16

Merged
merged 1 commit into from
May 14, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions templates/restic.cron.j2
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,21 @@ RESTIC_PASSWORD="{{ item.password }}"
{{ k | upper }}={{ v }}
{% endfor %}

# 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