homeserver/roles/mgrote_rsync/templates/rsync_mirror_mail.service.j2
Michael Grote 77650ce45f
All checks were successful
ansible-lint / gitleaks (pull_request) Successful in 4s
ansible-lint / Ansible Lint (pull_request) Successful in 37s
fgds
2024-11-10 10:26:53 +01:00

8 lines
442 B
Django/Jinja

{{ file_header | default () }}
[Unit]
Description=Send a Mail for rsync_mirror service after error or success rsync_mirror.service.
[Service]
Type=oneshot
ExecStart=/bin/bash -c '/usr/bin/journalctl -u rsync_mirror.service -xe | grep -E '\-----------------------|Source:|Literal data:|matched data:|sent' | tail -n {{ rsync_mirror_dirs | length * 6 }} | mail -aFROM:{{ rsync_mirror_user }}@mgrote.net -s "rsync_mirror - %H" {{ my_mail }}'