Six o'clock in the morning there is a server alarm said down, try to log on to find the login server no problem, PS-EF | grep MySQL when found mysqld service is also in, MySQL error log also no task error. But when viewing vim/var/log/messages, it was hard to find a problem, when trying to touch a file prompted ' Read-only file System ', then contacted the room to detect the fault.
However, when top is executed, it is found that there are many sendmail processes under the current user, as shown in, the sender is Crondaemon, suspect is related to the scheduled task, view the current user's scheduled tasks found a scheduled task that runs every minute, But the timed script didn't call SendMail, Ps-ef | grep SendMail | Wc-l statistics found that the SendMail process data is basically the number of minutes from the server failure to the current time.
650) this.width=650; "Src=" Http://s1.51cto.com/wyfs02/M01/8A/E7/wKiom1g-kpHwupKwAAC83P5yQLw090.png-wh_500x0-wm_3 -wmp_4-s_1428747374.png "title=" 1130.png "alt=" Wkiom1g-kphwupkwaac83p5yqlw090.png-wh_50 "/>
The crontab is that every execution calls SendMail email? Man 5 crontab When viewing the Help manual, find this passage:
In addition to LOGNAME, HOME, and SHELL, cron (8) would look at MAILTO if it had any reason to send mail as a result of Running commands in "this" crontab. If MAILTO is defined (and Non-empty), mail was sent to the user so named. If MAILTO is defined but empty (mailto= ""), no mail would be sent. Otherwise Mail is sent to the owner of the crontab. This option was useful if you decide on/bin/mail instead of/usr/lib/sendmail as your mailer when you install cron--/b In/mail doesnt do aliasing, and UUCP usually doesnt read its mail. If Mailfrom is defined (and non-empty), it'll be used as the envelope sender address, otherwise, "root" would be used.
To view the configuration file for crontab:
Cat/etc/crontab
Shell=/bin/bash
Path=/sbin:/bin:/usr/sbin:/usr/bin
Mailto=root
home=/
Can see mailto this line is not empty, if you do not want it to send e-mail, you can follow the manual said mailto this line to delete or change to mailto= ""
This article is from the "Always on the Road" blog, please be sure to keep this source http://chenql.blog.51cto.com/8732050/1878182
Due to the Crondtab timing task resulting in a large number of sendmail process solutions