Add borgmatic timer
This commit is contained in:
parent
8ee456df74
commit
40e622cf26
3 changed files with 51 additions and 0 deletions
11
files/borgmatic.service
Normal file
11
files/borgmatic.service
Normal file
|
@ -0,0 +1,11 @@
|
|||
[Unit]
|
||||
Description=Backup with borgmatic
|
||||
|
||||
[Service]
|
||||
Nice=19
|
||||
IOSchedulingClass=idle
|
||||
KillSignal=SIGINT
|
||||
ExecStart=/usr/bin/borgmatic
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
10
files/borgmatic.timer
Normal file
10
files/borgmatic.timer
Normal file
|
@ -0,0 +1,10 @@
|
|||
[Unit]
|
||||
Description=Daily backup with borgmatic
|
||||
|
||||
[Timer]
|
||||
OnCalendar=daily
|
||||
RandomizedDelaySec=3600
|
||||
Persistent=true
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
|
@ -76,3 +76,33 @@ files.put(
|
|||
mode='700',
|
||||
)
|
||||
|
||||
files.put(
|
||||
name='Push borgmatic timer',
|
||||
src='files/borgmatic.timer',
|
||||
dest='/etc/systemd/system/borgmatic.timer',
|
||||
user='root',
|
||||
group='root',
|
||||
mode='644',
|
||||
)
|
||||
|
||||
files.put(
|
||||
name='Push borgmatic service',
|
||||
src='files/borgmatic.service',
|
||||
dest='/etc/systemd/system/borgmatic.service',
|
||||
user='root',
|
||||
group='root',
|
||||
mode='644',
|
||||
)
|
||||
|
||||
systemd.daemon_reload(
|
||||
name='Reload systemd',
|
||||
user_mode=False,
|
||||
)
|
||||
|
||||
systemd.service(
|
||||
name='Enable borgmatic timer',
|
||||
service='borgmatic.timer',
|
||||
running=True,
|
||||
enabled=True,
|
||||
)
|
||||
|
||||
|
|
Reference in a new issue