Linux Shell script to send a message _ prohibit regular tasks

① scripting
operation error, the server periodically sends e-mail, directory / var / mail / below, leading to an increase in small files, affect server performance, the above additional error is empty, but also for this purpose

sed -i 's/^MAILTO=root/MAILTO=""/' /etc/crontab

② run the script

chmod u+x AutoSyncTime.sh
./AutoSyncTime.sh
或者
bash AutoSyncTime.sh

Note: The name of the custom script

③ script Description of content

# 编辑/etc/crontab文件
vim /etc/crontab
#替换格式
's/^
#替换的目标对象
MAILTO=root
#替换后的值等于什么
MAILTO=""

Published 976 original articles · won praise 151 · Views 250,000 +

Guess you like

Origin blog.csdn.net/weixin_40816738/article/details/104619697