Adept IT SysAdmin Tools This is the beginning (and hopefully not the end) of tools I shall write to help us (myself and other SysAdmins) do the day to day system administration jobs, quicker and easier. These Tools will be targetted at running on Solaris primarily, but will run on other systems as appropriate (The beauty of Java). This starts with the "findUsedSpace" tool, but shall grow in time. Find Used Space I've found that on enough occasions, I've run into the problem of a system's disk being full (or surprisingly over-utilised), and I need to find out quickly whats chewing up all the space. As opposed to mucking around with a stack of du's, I've written a java program that does all the work for you, and finds out where the space above a threshold you specify, is being used. This threshold *can* be as granular as bytes right through to gigabytes. The software performs about as quickly as a du on Solaris (its slightly slower, but not much); but this software provides more information and can also be run on Windows, Linux, etc. Examples So you can see where this might come in handy, some examples are provided Example 1: We wish to find all files/directories with 1 Gigabyte or more in them (this is the default, but we'll specify the params): [root@vir /]$findUsedSpace -t 1 -g findUsedSpace - Version 1.0-RC5 (C) Copyright 2006-2007 Geoff Ongley http://sysadmin.AdeptIT.com.au INFO: Running On Solaris, Excluding mounted Proc File Systems INFO: Excluding /proc INFO: Excluding /export/zones/ldapm1/root/proc INFO: Excluding /export/zones/proxy/root/proc Threshold: 1G Searching from / 2.48G /usr 2.73G / Example 2: We want to fine all files/directories with over 100 meg, but we also want to stop ourselves from hitting our NFS mounts (/net) and home dirs (/home). We specify a threshold of 100 (-t 100), we specify we want things in Megabytes (-m, this includes our threshold) and we exclude /net (-x /net) and /home (-x /home) [root@vir /]$findUsedSpace -t 100 -m -x /net -x /home findUsedSpace - Version 1.0-RC5 (C) Copyright 2006-2007 Geoff Ongley http://sysadmin.AdeptIT.com.au INFO: Running On Solaris, Excluding mounted Proc File Systems INFO: Excluding /proc INFO: Excluding /export/zones/ldapm1/root/proc INFO: Excluding /export/zones/proxy/root/proc Threshold: 100M Searching from / 214.72M /usr/share 441.67M /usr/lib 130.09M /usr/openwin/lib 190.0M /usr/openwin 199.64M /usr/sfw/lib 436.37M /usr/sfw 112.61M /usr/jdk/instances/jdk1.5.0/jre/lib 114.55M /usr/jdk/instances/jdk1.5.0/jre 159.66M /usr/jdk/instances/jdk1.5.0 159.66M /usr/jdk/instances 181.38M /usr/jdk 137.95M /usr/staroffice7/help 249.98M /usr/staroffice7/program 146.2M /usr/staroffice7/share 535.28M /usr/staroffice7 2536.24M /usr 2796.86M / Example 3: We want to find all files/directories with over 5G in /home. We specify our root directory (-d /home) and our threshold of 5 (-t 5) and gigs (-g) root@vir> findUsedSpace -d /home -t 5 -g findUsedSpace - Version 1.0-RC5 (C) Copyright 2006-2007 Geoff Ongley http://sysadmin.AdeptIT.com.au INFO: Running On Solaris, Excluding mounted Proc File Systems INFO: Excluding /proc INFO: Excluding /export/zones/ldapm1/root/proc INFO: Excluding /export/zones/proxy/root/proc Threshold: 5G Searching from /home (we found nothing, we have good users, don't we! Well, no, this is just a virtual machine for testing...) Usage: java findUsedSpace [-d