borgbase / ansible-role-borgbackup

Ansible role to set up Borg and Borgmatic
MIT License
229 stars 102 forks source link

Run systemd service with `systemd-inhibit` #122

Open agross opened 1 year ago

agross commented 1 year ago

This will prevent reboots or suspending while a backup is running:

[Service]
ExecStart=/bin/systemd-inhibit --why '%n' borgmatic -c /etc/borgmatic/{{ borgmatic_config_name }}

https://www.freedesktop.org/software/systemd/man/systemd-inhibit.html