Add pre-check for repository initialization in systemd service template (#11)

Co-authored-by: Karim BAIDI <karim@linux-man.fr>
This commit is contained in:
babidi34 2025-02-19 16:52:28 +01:00 committed by GitHub
parent f7a45a9f7a
commit 35d84f2f7f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -19,6 +19,8 @@ Environment="AWS_ACCESS_KEY_ID={{ restic_aws_access_key_id}}"
Environment="AWS_SECRET_ACCESS_KEY={{ restic_aws_secret_access_key}}" Environment="AWS_SECRET_ACCESS_KEY={{ restic_aws_secret_access_key}}"
{% endif %} {% endif %}
ExecStartPre=/bin/sh -c '{{ restic_path }} snapshots || {{ restic_path }} init'
{% if restic_check %} {% if restic_check %}
ExecStartPre={{ restic_path }} check ExecStartPre={{ restic_path }} check
{% endif -%} {% endif -%}