Ansible_workstation/roles/borgmatic/templates/service.j2

15 lines
563 B
Django/Jinja

#jinja2: lstrip_blocks: "True", trim_blocks: "True"
{{ ansible_managed | comment }}
[Unit]
Description=borgmatic {{ borgmatic_name }}backup
Wants=network-online.target
After=network-online.target
[Service]
Type=oneshot
# Delay start to prevent backups running during boot. Note that systemd-inhibit requires dbus and
# dbus-user-session to be installed.
ExecStart=/usr/bin/systemd-inhibit --who="borgmatic {{ borgmatic_name }}" --why="Prevent interrupting scheduled backup" /usr/bin/borgmatic -c {{ borgmatic_config_file }} --verbosity -1 --syslog-verbosity 1