Put files in directory structure

This commit is contained in:
Erik Westrup
2018-04-13 20:39:24 +02:00
parent aa7fdd0df9
commit 6b3a3a7773
10 changed files with 0 additions and 0 deletions

8
etc/restic/b2_env.sh Normal file
View File

@@ -0,0 +1,8 @@
# B2 credentials.
# Extracted settings so both systemd timers and user can just source this when want to work on my B2 backup.
# See https://restic.readthedocs.io/en/latest/030_preparing_a_new_repo.html
export RESTIC_REPOSITORY="b2:<b2-repo-name>"
export RESTIC_PASSWORD_FILE="/etc/restic/b2_pw.txt"
export B2_ACCOUNT_ID="<restic-account-id>"
export B2_ACCOUNT_KEY="<restic-account-key>"

1
etc/restic/b2_pw.txt Normal file
View File

@@ -0,0 +1 @@
<restic-password>

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=/root"

View File

@@ -0,0 +1,9 @@
[Unit]
Description=Backup with restic on schedule
[Timer]
OnCalendar=daily
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 Backblaze B2 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/local/sbin/systemd-email abc@gmail.com %i
User=root
Group=systemd-journal