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

Cronjobs often run as root. If the host has is configured to send emails when a cronjob is completed it will default to sending it to user@domain where the user is the user the cronjob runs as, and the domain is what was configured in the cron configuration.


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/




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

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

Search: