linux inode占用排查

inode使用占满

linux inode占用排查_第1张图片

逐层排查

先从根目录起,一级一级往下,统计inode文件数量。数字大就表示占用inode多。

for i in /*; do echo $i; find $i | wc -l; done
for i in /home/*; do echo $i; find $i | wc -l; done
for i in /home/deployer/*; do echo $i; find $i | wc -l; done
for i in /home/deployer/data/*; do echo $i; find $i | wc -l; done
for i in /home/deployer/data/logs/*; do echo $i; find $i | wc -l; done
for i in /home/deployer/data/logs/apps/*; do echo $i; find $i | wc -l; done

清理

清理3天前占用的inode文件。

find  /home/deployer/data/logs/apps/ -maxdepth 1 -type d -mtime +3 -exec rm -rf {} \;

你可能感兴趣的:(linux,linux,bash,运维)