Use absolute path for borgmatic

This commit is contained in:
Alik Kurdyukov 2025-06-14 13:37:09 +04:00
parent fa6acbeaa8
commit 5d0d42d2d2
3 changed files with 10 additions and 1 deletions

View File

@ -18,4 +18,8 @@
name: "{{ item }}"
state: present
loop: "{{ borg_distro_packages }}"
- name: Set absolute path to /usr/bin
ansible.builtin.set_fact:
borg_abs_path: "/usr/bin"
...

View File

@ -63,4 +63,9 @@
borg "$@"
dest: /usr/local/bin/borg
mode: "0755"
- name: Set absolute path to /usr/bin
ansible.builtin.set_fact:
borg_abs_path: "/usr/local/bin"
...

View File

@ -12,7 +12,7 @@ ConditionACPower=true
[Service]
Type=oneshot
User={{ borg_user }}
ExecStart=borgmatic -c /etc/borgmatic/{{ borgmatic_config_name }} {{ borgmatic_timer_flags }}
ExecStart={{ borg_abs_path }}/borgmatic -c /etc/borgmatic/{{ borgmatic_config_name }} {{ borgmatic_timer_flags }}
# Source: https://projects.torsion.org/borgmatic-collective/borgmatic/raw/branch/master/sample/systemd/borgmatic.service
# Security settings for systemd running as root, optional but recommended to improve security. You