added timer, fixed /root typo

This commit is contained in:
=
2022-11-03 13:27:06 +01:00
parent ece28723c5
commit 38fbe9613f
4 changed files with 54 additions and 2 deletions

View File

@@ -42,5 +42,5 @@ restic backup \
--verbose \
{% if pillar.podman is defined %}{{ salt['cmd.run']('podman info -f "{{.Store.VolumePath}}"', runas=pillar.podman.user ) }} \{% endif %}
/etc \
/ root \
/root \
/home

View File

@@ -0,0 +1,10 @@
[Unit]
Description=Run restic backup
[Service]
Type=oneshot
User={{ pillar.restic.user }}
ExecStart={{ salt['user.info'](pillar.restic.user).home }}/bin/backup.sh
[Install]
WantedBy=default.target

View File

@@ -0,0 +1,10 @@
[Unit]
Description=Restic backup timer
[Timer]
OnCalendar={{ pillar.restic.OnCalendar }}
RandomizedDelaySec=300
Unit=restic-backup.service
[Install]
WantedBy=timers.target