updated borg state

This commit is contained in:
Paul 2021-12-05 18:31:50 +01:00
parent 5b44c8f142
commit 801f8590ab

View File

@ -27,6 +27,11 @@ info "Starting backup"
info "Init repository backup"
borg init --encryption={{ job.encryption|default('repokey-blake2') }}
info "Starting before tasks"
{%- for task in job.before_tasks|default([]) %}
{{ task }}
{%- endfor %}
info "Creating new archive"
borg create \
--verbose \
@ -61,6 +66,11 @@ borg prune \
info "Cleaning up logs"
find {{ working_dir }}/logs/${backup_name}-*.log -mtime +{{ job.keep_logs_days|default(7) }} -delete
info "Starting after tasks"
{%- for task in job.after_tasks|default([]) %}
{{ task }}
{%- endfor %}
prune_exit=$?
global_exit=$(( backup_exit > prune_exit ? backup_exit : prune_exit ))