diff --git a/templates/restic_script_Linux.j2 b/templates/restic_script_Linux.j2 index fca2410..29db11c 100644 --- a/templates/restic_script_Linux.j2 +++ b/templates/restic_script_Linux.j2 @@ -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) }}