当前位置:网站首页>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
边栏推荐
- 美联储数字货币最新进展
- Apache Atlas Compilation and installation records
- JS time to get this Monday and Sunday, judge the time is today, before and after today
- ACFs file system creation, expansion, reduction and other configuration steps
- 神经元与神经网络
- Dolphin scheduler configuring dataX pit records
- Tensorflow & pytorch common error reporting
- Oracle view related
- Oracle index status query and index reconstruction
- Oracle creates tablespaces and modifies user default tablespaces
猜你喜欢
【项目】小帽外卖(八)
JMeter pressure test tool
Kettle--控件解析
crontab定时任务输出产生大量邮件耗尽文件系统inode问题处理
Decentralized Collaborative Learning Framework for Next POI Recommendation
Express②(路由)
自动化的艺术
The art of automation
Information: 2021 / 9 / 29 10:01 - build completed with 1 error and 0 warnings in 11S 30ms error exception handling
Jenkins construction and use
随机推荐
Use future and countdownlatch to realize multithreading to execute multiple asynchronous tasks, and return results after all tasks are completed
【报名】TF54:工程师成长地图与卓越研发组织打造
pycharm Install packages failed
Tensorflow & pytorch common error reporting
[VMware] address of VMware Tools
Analysis of unused index columns caused by implicit conversion of timestamp
函数只执行第一次的执行一次 once函数
Port occupied 1
Question bank and answer analysis of the 2022 simulated examination of the latest eight members of Jiangxi construction (quality control)
ACFs file system creation, expansion, reduction and other configuration steps
JS compares different elements in two arrays
Oracle view related
UML统一建模语言
专题测试05·二重积分【李艳芳全程班】
Analysis of cluster component gpnp failed to start successfully in RAC environment
Oracle告警日志alert.log和跟踪trace文件中文乱码显示
Dolphin scheduler integrates Flink task pit records
Dynamic subset division problem
SQL learning window function
剑南春把文字游戏玩明白了