What it means

Cron captures everything a job writes to stdout and stderr and mails it to the crontab's owner, or to MAILTO, through the local sendmail. Most servers and containers have no mail transfer agent (MTA) such as Postfix or Exim, so cron logs this line and throws the output away:

CRON[51873]: (deploy) CMD (/usr/local/bin/backup.sh)
CRON[51872]: (CRON) info (No MTA installed, discarding output)

The CMD line just above shows which job it was. The job ran. What it printed is gone.

Common causes

1. The job failed and said why. The most useful case: an error message, such as command not found or Permission denied, went to stderr and was discarded. Run the job again with its output saved:

/usr/local/bin/backup.sh >> /tmp/backup-debug.log 2>&1; echo "exit $?"

2. The job is just chatty. Progress lines, warnings, a curl progress bar. Harmless, but the line shows up on every run.

3. A mail server was removed or never installed. Minimal cloud images and Docker images ship without one. Confirm:

ls -l /usr/sbin/sendmail

How to fix

  1. Send each job's output to a log file you can read and rotate: 30 3 * * * /usr/local/bin/backup.sh >> /var/log/backup.log 2>&1
  2. For jobs whose output you never need, discard it explicitly with > /dev/null 2>&1.
  3. To stop cron from trying to mail at all, add MAILTO="" at the top of the crontab.
  4. If you do want mail, install an MTA. msmtp-mta relays through an existing SMTP account. Postfix in "Local only" mode delivers to /var/mail/<user>.
  5. Read the log after the next run. If it shows an error, fix that error: this line was only the messenger.

Is it just you?

If the job also runs at unexpected times, check the schedule in the cron expression generator, which lists the next run times in your timezone.

Get alerted next time

  • A healthcheck alerts when the job's ping does not arrive on schedule plus a grace period, so a failure no longer depends on reading mail or logs.
  • Chain the ping with && after the command, or call the URL with /fail appended from your error handling to alert at once.
  • Hyperping does not store the job's output, so keep the log file for the why.