0

We basically have ~250 users all running a mix of Windows XP and 7. All our users have been asked to place all their important files in a folder on their desktop called "Backup".

I basically need to figure out a way of calculating what the total size of all these folders amount to.

Any ideas? Programs? Scripts?

Thanks!

Touff
  • 183
  • 1
  • 3
  • 14

1 Answers1

1

What you have, basically, is two high-level problems:

  1. How to get the recursive size of a folder and all its contents (including sub-folders).
  2. How to solve problem #1 across a large number of machines on a network.

To solve #1, I suggest the easiest way is to use the du utility. This is a UNIX command-line utility that has a windows port; Grab it from: http://gnuwin32.sourceforge.net/packages/coreutils.htm

By default, du recursively scans from the current directory and prints the sizes and names. What you want is the summary as if you right-clicked the folder and did properties. So run it like this du -s Note the output is in bytes which is convenient for Excel work.

To solve #2 I suggest that you map a network drive to each computer in turn, run the du command (but appending to a file) and then do a sum in Excel. The du command will look like this: du -s >> backupSize.txt by default, the du output columns are tab-separated which imports easily into Excel.

You will have to solve the details of getting all those folders shared, making sure all the machines are available on the network, writing a batch file with a foreach style loop, and summing in Excel.

JGurtz
  • 523
  • 5
  • 13
  • 1
    I used to use Perl to recursively sum and display sorted totals. I imagine that this can also be done in any scripting language you are familiar with (VB, Python, ...) – RedGrittyBrick Nov 18 '10 at 17:02
  • Yea, in windows one could write a vbscript easily enough, but not writing anything is even easier. :) – JGurtz Nov 18 '10 at 17:07
  • 1
    Mapping the network drives might not be necessary if he has administrative permissions. You can just run du against the shares directly, e.g. \\workstation\c$\users\username\desktop. I imagine the challenge being to enumerate the user accounts on each workstation and then running du against every user profile. Personally I'd use Perl in combination with 'du'. – Lucky Luke Jun 01 '11 at 13:27