Crontab-caused frequent email sending

Source: Internet
Author: User

Crontab-caused frequent email sending

This afternoon, the customer sent an email to report that emails for file system monitoring and table space usage in a certain environment were frequently received, and they felt that they were sent once an hour, it can be sent once every 3 hours. The most direct association after receiving this question is the use of crontab.
The result is as follows:
> Crontab-l
# Minute Hour Month Day Month Weekday Command
######################################## #######################################
, ***/Oravl01/orainst/XXXXX/FileSystem. ksh
################### Tablespace alert-for all ################ ######################
, ***/Bin/ksh "/oravl01/orainst/dba/ENV/free_tbs_alert.ksh XXXX"
Let's take a look at the use of crontab. crontab contains six parameters, which represent the scripts to be run, namely minute, hour, day, week, month.
So for this question,
, Run the specified script at 52.
According to this configuration, it is reasonable to avoid frequent sending of unnecessary emails in the middle of the night. From the configuration point of view, it is run every three hours.
However, according to the customer's feedback, the frequency of sending is somewhat frequent. In this regard, the problem is somewhat embarrassing.
I checked the corresponding script content with questions, and did not find any special time settings. They are all routine checkpoints.
Finally, I had a simple communication with the customer with doubts. According to the current configuration, it is indeed three hours. If it is within three hours, what should be the problem, you can transfer the email to me. The customer's feedback was fast. They sent me the latest email and found that the two emails were basically the same. The time was very short, and the time was 52 minutes, this is consistent with the configuration in crontab, and the other is sent at 0. I am confused about this. I checked out the configuration of the local crontab and started searching in the relevant environment. It was not too hard to find the local crontab, finally, a similar configuration is found using crontab-l in an environment.
### Training environment-db server fs alert report ###
00, 9, 12, 15, 18, 21 *** ssh orainst @ xxxx'/bin/ksh/oravl01/orainst/XXXX/FileSystem. ksh'

### Training environment-db server table space alert report ###
00, 9, 12, 15, 18, 21 *** ssh orainst @ XXXX '/bin/ksh/oravl01/orainst/dba/ENV/free_tbs_alert.ksh XXXXX'
This configuration means that at, the script is run and the corresponding email is sent.
It is easy to solve this problem. Now we need to understand why this crontab needs to be configured on other servers rather than local servers. If you want to disable it, change the disabled one.
After a simple communication, I finally realized that the other server they used here is a proxy-like role, with a large number of crontab settings configured, through this client, you can control the running status of some data on each server. According to the initial agreement, a script is run three hours a day and a corresponding check is performed.
So why does the server inexplicably enable the crontab settings? Finally, we found that a DBA did a crontab test last Friday, but we didn't notice that the crontab settings have been configured in the background, the problem is fixed after being disabled.
In this simple case, we can find that many strange problems are the cause. If we trace the root cause, it is not a configuration problem or a problem caused by inconsistency of related coordination. The solution to such problems is to establish unified standards and permissions, so that similar problems can be avoided to a certain extent. It is easy to say, but it still needs to be improved.

Use crontab in Linux to create scheduled tasks

Routine scheduling of crontab in Linux

Linux crontab does not run troubleshooting

Ubuntu uses crontab for scheduled tasks

Linux scheduled task (at batch crontab anacron)

This article permanently updates the link address:

Related Article

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.