Results 1 to 4 of 4
I've got kind of an odd situation. I'm running into inode limit issues with our VPS, and I can't seem to figure out what's creating all these files. I've had ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 03-07-2009 #1Just Joined!
- Join Date
- Mar 2009
- Posts
- 2
Locate folders with the most files
I've got kind of an odd situation. I'm running into inode limit issues with our VPS, and I can't seem to figure out what's creating all these files. I've had our host increase the inode limit twice, but still running into the same issues.
I've found some extra files in the qmail queue, but they're really only a drop in the bucket. Something is creating a large number of what must be very small files, and I'm not sure what it might be.
What I'm hoping to find is some sort of command that will show me how many files are in each folder on the server. Googling really hasn't helped in this case, so I'm hoping someone here can help.
- 03-07-2009 #2Linux Newbie
- Join Date
- Mar 2009
- Posts
- 228
Create this script, call it ct.sh
Make is executable with: chmod 700 ct.shCode:#!/bin/bash find /mountpoint/* -xdev -type d | while read _dir do _ct=`find $_dir -type f | wc -l` echo $_ct $_dir done
Then run it with:
This will list the top 20 directories with many files.Code:./ct.sh | sort -k1,1nr | head 20
- 03-07-2009 #3Linux Newbie
- Join Date
- Feb 2009
- Location
- Third ring of Pergatory
- Posts
- 199
I might use
It will tell you which files got modified (or created) recursively from the directory named in directory 1 for however many seconds you set in "-t".Code:inotifywatch -r -e modify -t300 directory1
There is a lock out on the number of files a single instance can watch (8192 on my system as set by /proc/sys/fs/inotify/max_usr_watches) if you call it recursively and your target is larger than that, it bombs,
- 03-08-2009 #4Just Joined!
- Join Date
- Mar 2009
- Posts
- 2


Reply With Quote

