restic : restart on-failure

mise_a_niveau
korenstin 2025-01-22 12:37:09 +01:00
parent f3d51c3469
commit 1c7c69592a
1 changed files with 6 additions and 0 deletions

View File

@ -3,9 +3,15 @@
[Unit]
After=network-online.target
Wants=network-online.target
StartLimitBurst=3
StartLimitInterval=24h
[Service]
Restart=on-failure
RestartSec=30
EnvironmentFile=/etc/restic/{{ item.0 }}.env
ExecStartPre=restic unlock
ExecStart=restic backup --files-from=/etc/restic/{{ item.0 }}-includes --exclude-file=/etc/restic/{{ item.0 }}-excludes{{ restic.config[item.0].backup_extra_param | default("") }}
ExecStartPost=restic forget --prune{% for freq, n in restic.config[item.0].retention %} {{ freq }} {{ n }}{% endfor %}