当前位置:网站首页>Crontab timing task output generates a large number of mail and runs out of file system inode problem processing
Crontab timing task output generates a large number of mail and runs out of file system inode problem processing
2022-04-23 13:53:00 【Number line language】
In a certain station Linux Run commands in the system , Press tab Key supplementary output , Tips “ Unable to create temporary file for immediate document : There's no room on the device ” Information , As shown below :
Check the space usage of the file system , Normal output :
Check the file system inode Quantity usage , Root partition inode It's all exhausted :
Use command “ls -lR /var |grep “^-”|wc -l” Check the number of files in each directory under the root directory , Find out /var There are a lot of files in the directory .
Further inspection , confirm /var/spool/postfix/maildrop There are a lot of small files in the directory .
"mailq" The command shows a large number of root User to send mail queue ,“mail” There is also a lot of information in the output .
Get into /var/spool/postfix/maildrop Catalog , Delete all files in the directory .
# find ./ -type f | xargs rm -f
or
# find ./ -type f -exec rm -f {} ;
Root directory inode The service condition returns to normal , as follows :
meanwhile , Also on the root All emails received by the user have been emptied :
# echo > /var/spool/mail/root
Check the system for crontab Scheduled task list , It contains scripts that execute every minute , But the script didn't add “ > /dev/null 2>&1” perhaps “ > Log path and name 2>&1” To discard or retain the output of the script to the log file .
By default , Will crontab The output of the script executed by the scheduled task is sent to cron user . However, due to the maximum limit of the number of emails received by users or the total space occupied by emails , So sending unsuccessful emails is constantly /var/spool/postfix/maildrop Stack under directory , Eventually, the number of files in the file system is too large and the capacity of the file system is exhausted inode.
Add the content of the above standard configuration script .
in addition , You can also use crontab -e Change the user's scheduled task , Add a line to the front line of the script MAILTO=“”, Give Way cron The process does not send the output of the script by mail ( If you use /etc/crontab File to configure MAILTO Parameter words , The scheduled task script should also be placed in this file to take effect ), Examples are as follows :
# crontab -l
MAILTO=“”
* * * * * script1.sh
版权声明
本文为[Number line language]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204231351026603.html
边栏推荐
- 村上春树 --《当我谈跑步时,我谈些什么》句子摘录
- Technologie zéro copie
- Dolphin scheduler scheduling spark task stepping record
- Function executes only the once function for the first time
- Oracle lock table query and unlocking method
- Oracle database combines the query result sets of multiple columns into one row
- OSS cloud storage management practice (polite experience)
- Express②(路由)
- 服务器中挖矿病毒了,屮
- sys. dbms_ scheduler. create_ Job creates scheduled tasks (more powerful and rich functions)
猜你喜欢
初探 Lambda Powertools TypeScript
Postman reference summary
JMeter pressure test tool
Apache seatunnel 2.1.0 deployment and stepping on the pit
Reading notes: meta matrix factorization for federated rating predictions
Double pointer instrument panel reading (I)
解决方案架构师的小锦囊 - 架构图的 5 种类型
UML统一建模语言
Port occupied 1
Lenovo Saver y9000x 2020
随机推荐
[code analysis (4)] communication efficient learning of deep networks from decentralized data
L2-024 部落 (25 分)
第十五章 软件工程新技术
19c environment ora-01035 login error handling
Double pointer instrument panel reading (I)
商家案例 | 运动健康APP用户促活怎么做?做好这几点足矣
[code analysis (6)] communication efficient learning of deep networks from decentralized data
Jiannanchun understood the word game
ARGB transparency conversion
Android 面试主题集合整理
Leetcode brush question 𞓜 13 Roman numeral to integer
Ora-16047 of a DG environment: dgid mismatch between destination setting and target database troubleshooting and listening vncr features
leetcode--977. Squares of a Sorted Array
JS time to get this Monday and Sunday, judge the time is today, before and after today
[code analysis (3)] communication efficient learning of deep networks from decentralized data
Oracle modify default temporary tablespace
MySQL [read / write lock + table lock + row lock + mvcc]
Analysis of cluster component gpnp failed to start successfully in RAC environment
UML Unified Modeling Language
PG library to view the distribution keys of a table in a certain mode