Download

Download duHTMLtree - You will probably have to right-click and do a save as.

Or an easier way, from a terminal window is:
     curl -o duHTMLtree 'http://www.studiosells.net/msells/duHTMLtree/duHTMLtree'
     chmod a+rx ./duHTMLtree

Sample Output

Sample output 1
Sample output 2

Instructions

duHTMLtree is a perl script to render disk usage trees in HTML based on the output of the unix du command. The du output file can be generated once and then duHTMLtree can render multiple trees without incuring the overhead of rumbling your disk for every tree. duHTMLtree can run either as a CGI or from the command line.

http://www.omnigroup.com/applications/omnidisksweeper/ may do something similar with a GUI - I haven't looked at it.

As A Command Line Script

Generate a duk file with:
  mkdir /tmp/disktree ; du -k /some/path/here > /tmp/duk_mydisk.txt
Then run duHTMLtree with, say:
  ./duHTMLtree -s500M '-tMy Disk Tree' -n'My Disk' -c1 \
     /tmp/disktree/duk_mydisk.txt > /tmp/mydisktree.html
and then open the HTML file.

duHTMLtree -h will show you command line options. The color strings are defined within the script or you can also pass one on the command line.

The obvious way to use it is to generate the duk files through a cron job, say nightly or weekly, possibly on multiple systems and then feed them to duHTMLtree to build whatever trees you want. If you want to build a single document with multiple trees use the -b and -l options and build your own document header with relative links.

Note: The last update time is based on the modification time of the duk file so 'cp -rp' or 'scp -rp' is a good idea.

As a CGI

It's much nicer to have a dynamic view that you can adjust the size and colors on so duHTMLtree will also run as a CGI.

Edit duHTMLtree and modify the configuration to match yours. In particular the values for OK_REMOTE_IP and SCAN_DIR are important! The defaults are to use files from /tmp/disktree/duk_* and only permit access from 127.0.0.1 and 192.168.0.0/24.

Then put it in your cgi-bin directory:
  cp duHTMLtree /Library/WebServer/CGI-Executables
  chmod a+rx /Library/WebServer/CGI-Executables/duHTMLtree
Make sure you have some duk_*.txt files in your SCAN_DIR and browse to http://localhost/cgi-bin/duHTMLtree

-marty