News for hackers. Stuff that matters.
Re:Cron best practices by rhn_mk1 on Friday March 11, 2022 @06:22AM (#30638593)
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.
Re:Cron best practices by funcDropShadow on Friday March 11, 2022 @07:55AM (#30639208)
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
Re:Cron best practices by rhn_mk1 on Friday March 11, 2022 @04:55PM (#30646496)
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.

Re:Cron best practices by traceroute66 on Friday March 11, 2022 @08:41AM (#30639742)
> 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).

Re:Cron best practices by pabs3 on Friday March 11, 2022 @08:19AM (#30639450)
There is a systemd-cron package in Debian that does that, except it only sends email on success.