“(CRON) info (No MTA installed, discarding output)”
来源:互联网 发布:淘宝宝贝详情图片宽度 编辑:程序博客网 时间:2024/06/17 20:16
问题
使用crontab进行设置定时任务,任务没有执行.
使用命令
tail /var/log/syslog
查看文件,看到cron报错:
(CRON) info (No MTA installed, discarding output)
主要原因
报错的主要原因是没有配置邮件服务器.
导致出错的情况及解决办法
有两种情况会导致这个现象.
(1)命令中含有shell指令
执行命令
crontab -e
查看当前用户的计划任务
当你运行的任务中包含shell命令,就会报错.例如下面的第二个任务:
date >log./temp.sh >`date`.log
可以通过安装邮件服务器解决该问题.
sudo apt-get install postfix
重新配置邮件服务
sudo dpkg-reconfigure postfix
The user interface will be displayed. On each screen, select the following values:
Ok
Internet Site
NONE
mail.example.com
mail.example.com, localhost.localdomain, localhost
No
127.0.0.0/8, 192.168.0/24
Yes
0
+
all
(2)执行任务过程中会往屏幕输出内容
当你执行的是个脚本文件时,你可以把文件的输出重定向到某个文件中.例如:
cd /home/wang && ./temp.sh >temp.log
或者不需要保留执行的输出,则重定向到null中:
cd /home/wang && ./temp.sh >/dev/null 2>&1
阅读全文
0 0
- “(CRON) info (No MTA installed, discarding output)”
- 解决(CRON) info (No MTA installed, discarding output)
- Contabs日志中报错:No MTA installed, discarding output
- UBUNTU开启CRONTAB日志记录及解决NO MTA INSTALLED, DISCARDING OUTPUT问题
- Apache No services installed
- no jconsole plugin installed
- No output folder解决办法
- No installed service named "Apache2"
- Apache No services installed 错误
- Apache No services installed 解决方法
- Apache No services installed 错误
- no installed service named "apache2"
- Windows VS2013 Intro - Output Debug Info
- “No symbol table info available”
- MCLK1 pin has no output
- apache 安装后No services installed问题
- 关于 Apache No services installed 的办法
- apache装完后为什么显示no service installed?
- 文件存储
- mybatis简介-配置-简单例子
- java蓝桥试题字母图形
- 并发编程 synchronized
- java向上转型和向下转型
- “(CRON) info (No MTA installed, discarding output)”
- 了解百度原理才是做seo的灵魂
- BAT机器学习面试题及解析(281-285题)
- lightoj1008 Fibsieve`s Fantabulous Birthday
- 手把手教你用Python实现人脸识别
- synchronized的使用实例
- Java中Class类详解、用法及泛化
- Java 自定义的JTable
- 小团队如何运营一款棋牌游戏