这是我的crontab:
MAILTO=michael 02 11 * * * bash /home/michael/projectname/nightly_tests.sh * * * * * python /home/michael/projectname/throwaway/hello.py
我的用户名正确指定:
-bash-4.1 $ whoami迈克尔
以下是我想要每分钟运行的内容:
-bash-4.1$ cat /home/michael/projectname/throwaway/hello.py print "hello world"
我的邮件文件是空的:
-bash-4.1$ ll /var/mail/michael -rw-rw---- 1 michael mail 0 Feb 19 23:04 /var/mail/michael
为什么没有邮件被发送? 我能做些什么来解决这个问题?
我在CentOS(3.7.5-linode48)。
编辑 maillog这样说:
-bash-4.1$ sudo tail /var/log/maillog Apr 13 11:49:01 servername postfix/sendmail[6989]: warning: the Postfix sendmail command must be installed without set-uid root file permissions Apr 13 11:50:01 servername postfix/sendmail[6996]: warning: the Postfix sendmail command has set-uid root file permissions Apr 14 11:50:01 servername postfix/sendmail[6996]: warning: or the command is run from a set-uid root process Apr 13 11:50:01 servername postfix/sendmail[6996]: warning: the Postfix sendmail command must be installed without set-uid root file permissions Apr 13 11:51:01 servername postfix/sendmail[7003]: warning: the Postfix sendmail command has set-uid root file permissions Apr 13 11:51:01 servername postfix/sendmail[7003]: warning: or the command is run from a set-uid root process Apr 13 11:51:01 servername postfix/sendmail[7003]: warning: the Postfix sendmail command must be installed without set-uid root file permissions Apr 13 11:52:01 servername postfix/sendmail[7008]: warning: the Postfix sendmail command has set-uid root file permissions Apr 13 11:52:01 servername postfix/sendmail[7008]: warning: or the command is run from a set-uid root process Apr 13 11:52:01 servername postfix/sendmail[7008]: warning: the Postfix sendmail command must be installed without set-uid root file permissions
现在就去Google了。
这是CentOS与cron和postfix相结合的一个bug。 看到这个错误报告 。 据我所知,目前还没有解决的办法,但是你可以尝试安装旧版本的cron,看看是否有帮助。
我联系了服务器的pipe理员。 这是他不得不说的:
不,它比这更基本 – 邮件服务器不会默认运行。 我已经打开它,现在启用它,所以你应该得到大量的电子邮件刚刚被假脱机。
捂脸