In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
Editor to share with you how to achieve crontab implementation results in linux did not notify users by sending mail, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!
Symptom
A crontab task is set on a centos7 host, but after running mail when the time comes, it prompts No mail, that is, cron did not send an email to the user to notify the user of the execution result of the task
Investigation process
Check the crontab log
The logs of centos are managed by systemd, so you can view the related logs through systemctl.
Journalctl _ COMM=crond-- since=today
Or use root to view the log / var/log/cron
Sudo cat / var/log/cron | grep-v'/ usr/local/qcloud/stargate/admin/start.sh'
Eventually we will see a line in the log that prompts Jun 22 00:50:19 localhost CROND [21181]: (lujun9972) MAIL (mailed 102 bytes of output but got status 0x004b#012)
That is, the mail failed to be sent.
Check the mail log
Check the / var/log/maillog log and you will find that the log prompts Jun 22 00:50:19 localhost postfix/sendmail [21403]: fatal: parameter inet_interfaces: no local interface found for:: 1
In other words, the mail prompt cannot find the corresponding network card for the address of IPV6 on the host:: 1
Solution method
After commenting out the address corresponding to:: 1 in / etc/hosts, it is found that the error message of mail has become postfix/postdrop [5487]: warning: unable to look up public/pickup: No such file or directory
After searching, you only need to create the missing file and restart the postfix service.
Sudo mkfifo / var/spool/postfix/public/pickupsudo chown postfix:postdrop pickupsystemctl restart postfix.service above are all the contents of the article "how to achieve crontab execution results in linux without notifying users by sending mail". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.