Web Hosting Talk







View Full Version : Script or Utility Needed


fasttrak
11-08-2002, 09:14 AM
Hi,

This sounds crazy but I need to be able to find our how much room a client has taken on one of our virtual servers (we resell). I have been told by the support desk at the hosting company that the only way I can find this out is to add up every file in the root directory manually. This is insane but they will not budge on this.

Does any one know of a script or utility I can place in the root that will report back on the size of the folder and all sub folders contained.

faculty
11-08-2002, 09:45 AM
CPANEL?

fasttrak
11-08-2002, 09:53 AM
Will that work on WIN2K on a non dedicated server (virtual account)

TowerHost
11-08-2002, 10:11 AM
Write an ASP script :)

MarkIL
11-08-2002, 10:18 AM
du (http://www.delorie.com/gnu/docs/fileutils/du.1.html) -sH /usr/home/client

ScottD
11-08-2002, 10:23 AM
If the environment is a UNIX derivative or in the case of Win32 they have Cygwin, MKS, or some other UNIX tools then the following command should work if executed from a shell (as root):echo "0 `find / -uid 501 -printf " + %k" 2>/dev/null`" | bc
Substitute the 501 with the uid of the actual user.

Alex042
11-08-2002, 01:57 PM
Do a search at a scripting site like hotscripts.com or aspin.com. I've found at least a handful or so that will provide a file list on an ASP page with sizes of all subdirectories directly under the script folder.

fasttrak
11-08-2002, 04:33 PM
Sorted it. Thanks Alex. I tried Scriptsearch prior to posting, never thought of Aspin.

Cheers

Layerblue
11-08-2002, 05:53 PM
<%
dir = Request("dir")
set directory=server.createobject("scripting.filesystemobject")
set allfiles=directory.getfolder("d:\domains\users\")
for each directory in allFiles.subfolders
if right(directory.Name,3) <> "cnf" then
total_size=total_size + directory.size %>
<% end if
next %>
<%= formatnumber((total_size/1024/1024),2) %>

change the d:\domains\users\ to whatever path they are at, and save it as an ASP page.. Call the asp page in a web browser..