diff --git a/roles/mgrote.zfs_sanoid/templates/syncoid.service.j2 b/roles/mgrote.zfs_sanoid/templates/syncoid.service.j2 index fc69d41b..eda86d2a 100644 --- a/roles/mgrote.zfs_sanoid/templates/syncoid.service.j2 +++ b/roles/mgrote.zfs_sanoid/templates/syncoid.service.j2 @@ -3,7 +3,7 @@ [Unit] Description=Send zfs snapshots with sanoid/syncoid. OnFailure=syncoid_mail.service - +OnSuccess=syncoid_mail.service [Service] Type=oneshot diff --git a/roles/mgrote.zfs_sanoid/templates/syncoid_mail.service.j2 b/roles/mgrote.zfs_sanoid/templates/syncoid_mail.service.j2 index 953b3546..8b7d6ea0 100644 --- a/roles/mgrote.zfs_sanoid/templates/syncoid_mail.service.j2 +++ b/roles/mgrote.zfs_sanoid/templates/syncoid_mail.service.j2 @@ -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 }}'