Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The one reason I don't use systemd timers is that they don't have an automatic, reliable way to send me an email with their output.


If you happen to be on a Linux system with a properly configured mta (mail daemon), which you are if cron is able to send emails, you can just pipe the output of your command to sendmail


It would have been nice until extra logic comes in: cron doesn't send an email when there is no output.

Which is exactly what I want! Error? I must know. Output? If I left any, then it's a notification, and I must know. No output? A maintenance task succeeded, nothing to report.


> The one reason I don't use systemd timers is that they don't have an automatic, reliable way to send me an email with their output.

I can't remember the exact unit file syntax but you can define Before/After hooks, so you can point that to a script that emails people (or in my case pushes to a notification queue).


There is a systemd-cron package in Debian that does that, except it only sends email on success.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: