Feat: borgmatic start after boot
This commit is contained in:
9
roles/borgmatic/templates/borgmatic.afterboot.timer.j2
Normal file
9
roles/borgmatic/templates/borgmatic.afterboot.timer.j2
Normal file
@@ -0,0 +1,9 @@
|
||||
[Unit]
|
||||
Description=Run borgmatic {{ borgmatic_name }}backup
|
||||
|
||||
[Timer]
|
||||
OnBootSec=2min
|
||||
Persistent=true
|
||||
|
||||
[Install]
|
||||
WantedBy=timers.target
|
||||
@@ -1,3 +1,5 @@
|
||||
{{ ansible_managed | comment }}
|
||||
|
||||
[Unit]
|
||||
Description=borgmatic backup
|
||||
Wants=network-online.target
|
||||
@@ -50,5 +52,5 @@ LogRateLimitIntervalSec=0
|
||||
|
||||
# Delay start to prevent backups running during boot. Note that systemd-inhibit requires dbus and
|
||||
# dbus-user-session to be installed.
|
||||
ExecStartPre=sleep 1m
|
||||
ExecStart=systemd-inhibit --who="borgmatic" --why="Prevent interrupting scheduled backup" /usr/bin/borgmatic -c /etc/borgmatic/{{ borgmatic_config_name }} --verbosity -1 --syslog-verbosity 1
|
||||
ExecStartPre=/usr/bin/sleep 1m
|
||||
ExecStart=/usr/bin/systemd-inhibit --who="borgmatic" --why="Prevent interrupting scheduled backup" /usr/bin/borgmatic -c {{ borgmatic_config_file }} --verbosity -1 --syslog-verbosity 1
|
||||
|
||||
Reference in New Issue
Block a user