(CRON) info (No MTA installed, discarding output
在ubuntu里面使用定时任务cron来执行一个shell脚本(shell脚本内容是执行一个可执行jar包),在系统日志里面看到
less var/log/syslog
(CRON) info (No MTA installed, discarding output)
...
是因为没有配置邮件服务器
可以通过安装邮件服务器解决该问题
sudo apt-get install postfix
重新配置邮件服务
sudo dpkg-reconfigure postfix
在cron中执行shell脚本的时候需要输出的log日志时,可以将输出的log重定向到文件当中
sh /opt/test/shell.sh>/var/log/syslog
重定向到var/log的syslog文件当中
在Ubuntu系统中,使用cron执行shell脚本时遇到(CRON)info(NoMTAinstalled,discardingoutput)提示,表明系统没有配置邮件服务器。为了解决这个问题,可以安装postfix邮件服务器并重新配置。同时,若要保存脚本输出的日志,可以将日志重定向到指定文件,例如/var/log/syslog。

3850

被折叠的 条评论
为什么被折叠?



