This commit is contained in:
Tobias Trabelsi
2019-01-01 19:38:24 +01:00
commit 8aaaa8fa7c
13 changed files with 379 additions and 0 deletions

View File

@ -0,0 +1,10 @@
[Unit]
Description=Backup with restic to Backblaze B2
OnFailure=status-email-user@%n.service
[Service]
Type=simple
Nice=10
ExecStart=/usr/local/sbin/restic_backup.sh
# $HOME or $XDG_CACHE_HOME must be set for restic to find /root/.cache/restic/
Environment="HOME=/home/lerentis/"

View File

@ -0,0 +1,9 @@
[Unit]
Description=Backup with restic on schedule
[Timer]
OnCalendar=weekly
Persistent=true
[Install]
WantedBy=timers.target

View File

@ -0,0 +1,9 @@
[Unit]
Description=Check restic backup Backblaze B2 for errors
OnFailure=status-email-user@%n.service
Conflicts=restic.service
[Service]
Type=simple
Nice=10
ExecStart=/usr/local/sbin/restic_check.sh

View File

@ -0,0 +1,9 @@
[Unit]
Description=Check restic backup for errors on a schedule
[Timer]
OnCalendar=monthly
Persistent=true
[Install]
WantedBy=timers.target

View File

@ -0,0 +1,11 @@
# Source: https://serverfault.com/questions/876233/how-to-send-an-email-if-a-systemd-service-is-restarted
# Source: https://wiki.archlinux.org/index.php/Systemd/Timers#MAILTO
[Unit]
Description=Send status email for %i to user
[Service]
Type=oneshot
ExecStart=/usr/bin/notify-send "Backup Status:" %i
User=lerentis
Group=systemd-journal