By default, the output of each cron job is collected by cron, and sent via email each time the job completes.
What causes this error
If you see
(CRON) info (No MTA installed, discarding output) messages in your syslog it means that there is output from your cron job, but your server does not have a Message Transfer Agent installed to process the output into an email.
This is not a problem with your cron job itself, and does NOT mean that your cron job is failing.
How to fix No MTA installed errors
There are 3 ways you can fix this error:
1. Install an MTA like the popular
postfix. This can be installed in most cases from a package manager. For example, on Ubuntu you may run:
sudo apt-get install postfix
If you select
local installation, the output from your cron jobs will be relayed to a local "mailbox" that you can easily tail:
sudo tail -f /var/mail/<cron user>
2. If you don't care about cron emails, you can silence the error by disabling emails from your crontab. The easiest way to do this is to add the following to the top of the crontab file:
3. The final option is simply to ignore this error. It is not a fatal error, and does not impact the success of your cron job itself.
Want alerts if you cron jobs stop working?
Monitor your cron jobs with Cronitor to easily collect output, capture errors and alert you when something goes wrong.