4 ms·
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
by ecnahc515 1y ago
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.
- dijit 1y agoMinor 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.
- threePointFive 1y agoMoreutils 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.
- stevekemp 1y agoI copied the same idea in my static collection of sysadmin utilities: https://github.com/skx/sysbox/ https://github.com/skx/sysbox/