2021-03-11 23:29:57 +01:00
|
|
|
{{ ansible_managed | comment }}
|
|
|
|
|
|
|
|
[Unit]
|
|
|
|
Description=Service for borgmatic backup
|
|
|
|
Wants=network-online.target
|
|
|
|
After=network-online.target
|
|
|
|
ConditionACPower=true
|
|
|
|
|
|
|
|
[Service]
|
2021-03-15 01:04:42 +01:00
|
|
|
Type=simple
|
2021-03-11 23:29:57 +01:00
|
|
|
ProtectSystem=full
|
|
|
|
CapabilityBoundingSet=CAP_DAC_READ_SEARCH CAP_NET_RAW
|
|
|
|
|
|
|
|
# Lower CPU and I/O priority.
|
|
|
|
Nice=19
|
|
|
|
CPUSchedulingPolicy=batch
|
|
|
|
IOSchedulingClass=best-effort
|
|
|
|
IOSchedulingPriority=7
|
|
|
|
IOWeight=100
|
|
|
|
|
|
|
|
Restart=no
|
2021-03-16 13:46:46 +01:00
|
|
|
# Prevent rate limiting of borgmatic log events. If you are using an older
|
|
|
|
# version of systemd that doesn't support this (pre-240 or so), you may have
|
|
|
|
# to remove this option.
|
2021-03-11 23:29:57 +01:00
|
|
|
LogRateLimitIntervalSec=0
|
|
|
|
|
2021-03-16 13:46:46 +01:00
|
|
|
# Delay start to prevent backups running during boot. Note that
|
|
|
|
systemd-inhibit requires dbus and dbus-user-session to be installed.
|
2021-03-14 18:23:44 +01:00
|
|
|
# ExecStartPre=sleep 1m
|
2021-03-16 13:46:46 +01:00
|
|
|
ExecStart=systemd-inhibit --who="borgmatic" \
|
|
|
|
--why="Prevent interrupting scheduled backup" \
|
|
|
|
/usr/bin/borgmatic -v 2
|