Add systemd unit for backup

master
Quentin Duchemin 2019-03-25 23:01:34 +01:00
parent 3e9a7d8f87
commit b7b68ba57a
Signed by: Chosto
GPG Key ID: 0547178FEEDE7D6B
4 changed files with 22 additions and 0 deletions

View File

@ -0,0 +1,6 @@
[Unit]
Description=Backup OVH
OnFailure=notify-backup-failure
[Service]
Type=oneshot
ExecStart=/home/.config/backup/rsync/rsync_snapshot.sh 51.75.250.228

View File

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

View File

@ -0,0 +1 @@
/etc/systemd/system

View File

@ -0,0 +1,6 @@
[Unit]
Description=Send mail on backup failure
[Service]
Type=oneshot
ExecStart=/usr/bin/bash -c '{ echo -e "Subject: Backup failed\n\nMachine info :\n" ; hostnamectl ; echo -e "\n\nLogs:\n\n" ; journalctl -n 20 -u backup.service; } | sendmail -F "Quentin Duchemin" -f "desktop@chosty.fr" quentin.duchemin@hds.utc.fr'