updated borg state

This commit is contained in:
Paul 2023-07-02 21:32:58 +02:00
parent 2d5ad8d45c
commit a707d697a4

View File

@ -33,16 +33,16 @@ info "Starting before tasks"
{%- endfor %} {%- endfor %}
info "Creating new archive" info "Creating new archive"
borg create \ borg create \
--verbose \ --verbose \
--filter AME \ --filter AME \
--list \ --list \
--stats \ --stats \
--show-rc \ --show-rc \
--compression {{ job.compression|default('lz4') }} \ --compression {{ job.compression|default('lz4') }} \
{%- if job.excluded_dirs is defined -%} {%- if job.excluded_dirs is defined -%}
{%- for exclude in job.excluded_dirs %} {%- for exclude in job.excluded_dirs %}
--exclude '{{ exclude }}' \ --exclude '{{ exclude }}' \
{%- endfor %} {%- endfor %}
{%- endif %} {%- endif %}
--exclude-caches \ --exclude-caches \
@ -55,13 +55,13 @@ borg create \
backup_exit=$? backup_exit=$?
info "Pruning repository" info "Pruning repository"
borg prune \ borg prune \
--list \ --list \
--prefix $backup_name'-' \ -a $backup_name'-' \
--show-rc \ --show-rc \
--keep-daily {{ job.keep_daily|default(7) }} \ --keep-daily {{ job.keep_daily|default(7) }} \
--keep-weekly {{ job.keep_weekly|default(4) }} \ --keep-weekly {{ job.keep_weekly|default(4) }} \
--keep-monthly {{ job.keep_monthly|default(6) }} \ --keep-monthly {{ job.keep_monthly|default(6) }} \
info "Cleaning up logs" info "Cleaning up logs"
find {{ log_dir }}/${backup_name}-*.log -mtime +{{ job.keep_logs_days|default(7) }} -delete find {{ log_dir }}/${backup_name}-*.log -mtime +{{ job.keep_logs_days|default(7) }} -delete