| 1 |
# This unit is responsible for sending an email |
| 2 |
# if a duply-related service unit fails |
| 3 |
# |
| 4 |
# Make sure running echo test | mail YOURUSER |
| 5 |
# results in a new email in your inbox. |
| 6 |
# |
| 7 |
# You may want to review /etc/aliases to read: |
| 8 |
# YOURUSER: YOURUSER@YOUR_EMAIL_PROVIDER.com |
| 9 |
# |
| 10 |
# If you're using msmtp for instance, then you'll |
| 11 |
# need to add this line to msmtprc: |
| 12 |
# aliases /etc/aliases |
| 13 |
|
| 14 |
[Unit] |
| 15 |
Description=Email notification for failed duply systemd units |
| 16 |
|
| 17 |
[Service] |
| 18 |
Type=oneshot |
| 19 |
ExecStart=/bin/bash -c '/bin/systemctl --user status %i | /usr/bin/mail -s "[SYSTEMD_Notification - %i on %H] Fail" %u' |