“Centos7上crontab不执行”的版本间的差异

来自linux中国网wiki
跳到导航 跳到搜索
 
第13行: 第13行:
 
]# crontab  -l
 
]# crontab  -l
 
*/1  *  *  * *  /bin/bash  /root/evan/love  
 
*/1  *  *  * *  /bin/bash  /root/evan/love  
 +
 +
 +
通过查看maillog,发现了下面的报错
 +
 +
cat  /var/log/maillog
 +
 +
stfix/sendmail[8087]: fatal: parameter inet_interfaces: no local interface found for ::1这是什么错误了(参数inet_interfaces:未找到::1的本地接口),又经过一番查找,终于找到了解决办法
 +
 +
  
 
#解决办法  
 
#解决办法  
第27行: 第36行:
 
inet_interfaces = all
 
inet_interfaces = all
  
 +
或者  只是
 +
将/etc/postfix/main.cf文件中inet_interfaces值改为all
  
 
还有写命令要 全部绝对路径
 
还有写命令要 全部绝对路径
第34行: 第45行:
  
 
https://blog.csdn.net/sd4493091/article/details/83345661
 
https://blog.csdn.net/sd4493091/article/details/83345661
 +
 +
[https://blog.csdn.net/nero_claudius/article/details/102976144  Linux定时任务,执行shell文件失败问题&&mailed 73 bytes of output but got status 0x004b#012报错解决]
  
 
[[category:ops]]
 
[[category:ops]]

2020年4月24日 (五) 02:19的最新版本

腾迅云centos7上crontab不执行

定时任务不成功   看 cron log 

 CROND[5388]: (root) CMD (bash  /root/evan/love )
Apr 23 19:33:02 aliyun-jump-host CROND[5387]: (root) MAIL (mailed 294 bytes of output but got status 0x004b#012)
Apr 23 19:34:01 aliyun-jump-host CROND[5403]: (root) CMD (bash  /root/evan/love )
Apr 23 19:34:01 aliyun-jump-host CROND[5402]: (root) MAIL (mailed 294 bytes of output but got status 0x004b#012)
^C


全不成功的 
]# crontab  -l
*/1  *  *  * *   /bin/bash  /root/evan/love 


通过查看maillog,发现了下面的报错

cat  /var/log/maillog

stfix/sendmail[8087]: fatal: parameter inet_interfaces: no local interface found for ::1这是什么错误了(参数inet_interfaces:未找到::1的本地接口),又经过一番查找,终于找到了解决办法



#解决办法 
vim  /etc/postfix/main.cf

inet_interfaces = localhost

# Enable IPv4, and IPv6 if supported
inet_protocols = all


删掉或者注释  添加 

inet_interfaces = all

或者  只是 
将/etc/postfix/main.cf文件中inet_interfaces值改为all

还有写命令要 全部绝对路径

https://cloud.tencent.com/developer/article/1594636

https://blog.csdn.net/sd4493091/article/details/83345661

Linux定时任务,执行shell文件失败问题&&mailed 73 bytes of output but got status 0x004b#012报错解决