mirror of
https://github.com/roles-ansible/ansible_role_restic.git
synced 2024-12-11 23:41:32 +01:00
Adds cron tag depending on execution
This commit is contained in:
parent
d727654d27
commit
d6bb19bf1a
1 changed files with 8 additions and 3 deletions
|
@ -49,12 +49,17 @@ BACKUP_SOURCE={{ item.src }}
|
|||
{#
|
||||
Define backup commands
|
||||
#}
|
||||
if [[ -z ${CRON+x} ]]; then
|
||||
MODE_TAG="--tag manual"
|
||||
else
|
||||
MODE_TAG="--tag cron"
|
||||
fi
|
||||
{% if item.stdin is defined and item.stdin == true %}
|
||||
{{ item.stdin_cmd }} | {{ restic_install_path }}/restic backup --stdin --tag manual {{ tags(item.tags) }} {{ stdin_filename(item.stdin_filename) }} $@
|
||||
{{ item.stdin_cmd }} | {{ restic_install_path }}/restic backup --stdin $MODE_TAG {{ tags(item.tags) }} {{ stdin_filename(item.stdin_filename) }} $@
|
||||
{% else %}
|
||||
{{ restic_install_path }}/restic backup $BACKUP_SOURCE --tag manual {{ tags(item.tags) }} $@
|
||||
{{ restic_install_path }}/restic backup $BACKUP_SOURCE $MODE_TAG {{ tags(item.tags) }} $@
|
||||
{% endif %}
|
||||
{#
|
||||
Define stdin forget commands
|
||||
#}
|
||||
{{ restic_install_path }}/restic forget --prune --tag manual --path {{ path(item) }} {{ retention_pattern(item) }}
|
||||
{{ restic_install_path }}/restic forget --path {{ path(item) }} {{ retention_pattern(item) }}
|
||||
|
|
Loading…
Reference in a new issue