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

Minor nitpicky correction: cron only sends an email if there's any stdout of the job.

This is an important distinction because if you have configured mail forwarding, your cron jobs should be configured to output only on error.. then any emails are actionable.



Moreutils has a great command `chronic` which is a wrapper command like `time` or `sudo`, ie. you just run `chronic <command>`. It'll supress stdout and stderr until the command exits at which point it will print only if the exit code was non-zero.


I copied the same idea in my static collection of sysadmin utilities:

https://github.com/skx/sysbox/




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

Search: