Due to the Crondtab timing task resulting in a large number of sendmail process solutions

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.