syncoid: send mail on success (#567)

Reviewed-on: #567
Co-authored-by: Michael Grote <michael.grote@posteo.de>
Co-committed-by: Michael Grote <michael.grote@posteo.de>
This commit is contained in:
Michael Grote 2023-08-04 17:33:42 +02:00 committed by mg
parent 9982dd1207
commit 3f83b3870b
2 changed files with 3 additions and 3 deletions

View file

@ -3,7 +3,7 @@
[Unit]
Description=Send zfs snapshots with sanoid/syncoid.
OnFailure=syncoid_mail.service
OnSuccess=syncoid_mail.service
[Service]
Type=oneshot

View file

@ -1,8 +1,8 @@
{{ file_header | default () }}
[Unit]
Description=Send a Mail in case of an error in sanoid.service.
Description=Send a Mail for sanoid service after error or success sanoid.service.
[Service]
Type=oneshot
ExecStart=/bin/bash -c '/bin/systemctl status syncoid.service | mail -s "[ERROR] syncoid - %H" {{ empfaenger_mail }}'
ExecStart=/bin/bash -c '/usr/bin/journalctl -u syncoid.service -n 20| mail -s "syncoid - %H" {{ empfaenger_mail }}'