Crontab with sh message "No MTA installed, discarding output"

Forum rules
Before you post please read how to get help
Post Reply
ruyzz
Level 1
Level 1
Posts: 28
Joined: Sat Feb 24, 2018 11:01 pm

Crontab with sh message "No MTA installed, discarding output"

Post by ruyzz » Tue Jan 08, 2019 12:50 pm

Hi all:

I have a crontab as follows:
/etc/cron.d

Code: Select all

SHELL=/bin/bash
47 10 * * 2 root /bin/example.sh
but when viewing the status, the following appears:

Code: Select all

ene 08 10:47:01 cln-001 cron[703]: (*system*example) RELOAD (/etc/cron.d/example)
ene 08 10:47:01 cln-001 CRON[7152]: pam_unix(cron:session): session opened for user root by (uid=0)
ene 08 10:47:01 cln-001 CRON[7157]: (root) CMD (/bin/example.sh)
ene 08 10:47:01 cln-001 CRON[7152]: (CRON) info (No MTA installed, discarding output)
ene 08 10:47:01 cln-001 CRON[7152]: pam_unix(cron:session): session closed for user root

Can someone tell me if this message is normal or just can not run it as root?

Code: Select all

ene 08 10:47:01 cln-001 CRON[7152]: (CRON) info (No MTA installed, discarding output)
Last edited by ruyzz on Thu Jan 10, 2019 4:26 pm, edited 1 time in total.

gm10
Level 15
Level 15
Posts: 5961
Joined: Thu Jun 21, 2018 5:11 pm

Re: Crontab with sh message "No MTA installed, discarding output"

Post by gm10 » Tue Jan 08, 2019 2:15 pm

The facts aside that using sudo in a script run by root is superfluous and the idea of dropping caches via cron is, well, no comment, you didn't specifically configure MAILTO="", so cron is trying mail you the output created by your cron job. Output which is only getting created because of that unnecessary sudo tee construct btw. Also: sysctl vm.drop_caches=3.

Post Reply

Return to “Scripts & Bash”