crontab

今天写了个crontab定时任务,遇到了小问题,顺便记录下

  • crontab日志文件
    查错:
    tail -f /var/log/cron发现如下错误:
    crontab无法执行且(root) MAIL (mailed 54 bytes of output but got status 0x004b#012错误
  • 根本原因
    脚本错误->需要将错误信息发送到mail->设置错误导致无法发送mail->cat /var/log/cron中提示发送mail错误
  • 解决办法
    1、编辑/etc/postfix/main.cf文件,把inet_interfaces = all这一行前面的注释符号取消。
    2、注释掉inet_interfaces = localhost
    3、service postfix start
posted @ 2022-01-26 13:51  dch_21  阅读(53)  评论(0编辑  收藏  举报