[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 415
  • Last Modified:

Locate fastest growing file

I'm looking at a Solaris 10 system where the application is currently idle, yet i've seen free space on / go from two and a half gigabytes to 112 megabytes in the past 18 hours or so.  How do i detect what file or directory is growing at that rate?
0
xoxomos
Asked:
xoxomos
  • 6
  • 3
1 Solution
 
sentnerCommented:
Sounds like a log out of control.  Run:  du -kx / | sort -n | tail -30
0
 
sentnerCommented:
Oh, one note:  If you don't have the gnu version of du installed, you'll have to specify the path:
/usr/xpg4/bin/du -kx / | sort -n | tail -30
0
 
xoxomosAuthor Commented:
This Solaris complains the the x is illegal

oracle@bb4:/u01/app/oracle/admin/BB600/bdump$ du -kx / | sort -n | tail -30
du: illegal option -- x
usage: du [-a] [-d] [-h|-k] [-r] [-o|-s] [-H|-L] [file ...]
0
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
sentnerCommented:
Right, that's why I posted the correction. :)  You have to use the xpg4 version.
/usr/xpg4/bin/du -kx / | sort -n | tail -30

If you don't have that installed, you can use it without the -x option, but it won't exclude other filesystems.
0
 
sentnerCommented:
Another option in case you don't have the xpg version is to use find, and look for files that were modified today over a certain size.  For example, this will find all files over 100MB in the root filesystem (-mount skips other filesystems) modified 0 days ago.
find / -mount -mtime 0 -size +100000000c -ls

0
 
xoxomosAuthor Commented:
find / -mount -mtime 0 -size +100000000c -ls
Thats what i was looking for ;-)
but i guess something is making tons of smaller files instead since nothing is being found :-(
0
 
sentnerCommented:
If something is making smaller files, you can reduce the size you're searching for (the "c" on the end of the number stands for characters).  ie, 1MB would be 1000000c.  

Another option you can use if you don't want to include the size, is to search all files modified today (mtime 0), and do a sorted long listing on them:

ls -lrtd `find / -mount -mtime 0 -print` |tail -30
0
 
xoxomosAuthor Commented:
There must have been something else happening.  The systems person rebooted the machine a few days ago and / has been at a constant 17G free spaces ever since whereas before 2G  free space per day was disappearing.
0
 
sentnerCommented:
Did you ever find a file or directory that was being modified?  Another possibility is that something was opening files, writing to them, and something was removing the files while they're still open.  If that happens, the filesystem won't release them until the process closes the file handle, or the process is killed.  In that case, a reboot would fix the problem.  Are there any log rotation scripts that were recently put in place?  If not, it could simply have been a rogue process.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 6
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now