Folder size with multiple exclussions

Trying to find a way to get the home directory sizes of users, but excluding specific wildcards. I have this, based off of JG’s work. But it seems like there would be a way to speed up the process. I am thinking about something like “whose name of it is not contained in set (“dmg”;“vmwarevm”;“etc”)”, but i can’t figure out the actual relevance. Any ideas or thoughts on how that could be accomplished?

((((sum of sizes of descendants whose (name of it as lowercase does not end with “dmg” AND name of it as lowercase does not end with “vmwarevm” and pathname of it does not contain “AppData” and pathname of it as lowercase does not contain “cache”) of it) /1048576) ) of folder “c:\users” )

This kind of request comes up every once in a while. It is STRONGLY recommended that you don’t do this though Relevance in a Property.

Depending on how large the Home Directories are, and how fast/slow the disks that hold them are, you could slow the client way down.

Remember, the BES Client will, by default, only work for 10ms at a time before waiting/sleeping for 480ms. This is how it keeps the CPU utilization under control and keeps from monopolizing the client system. If you are testing the Relevance in the Fixlet Debugger, then unless you are using the "Debug–>Evaluate Using–>Local Client Evaluator option, you won’t get a realistic idea of how long the process will take. Be sure you have configured the Debugger to Show Evaluation Time (under the View menu).

If you insist on doing this as a property, you must also make sure that you DO NOT evaluate this property for Every Report. Maybe no more frequently than every 6-12 hours, Better yet, no more than once a day.
.

Hi @TimRice

I agree. And the use of BigFix for this is intended for a one-time awareness of a small subset of total users. My plan was to run this as an every 30-day property, then destroy the property after 2 or 3 days.

The request was to understand how much drive space we need to buy in order to backup everything that is not a few specific file types. So once we quoted the hardware, this would no longer be needed.

Any ideas about how to exclude file types besides how I listed it here.

And thank you for the tip about the debugger. Do you know of any way to do that same local client evaluator on the mac or linux qna apps?

Chris

I’ve not used this one before, but found it with a quick Google Search for “command line utility folder size”.

You could try doing something similar with “GetFoldersizePortable” using a Task to generate the data.
http://www.GetFoldersize.com/getfoldersize_help/commandline.php

Once you have the data generated, you can use Relevance to extract the data you want from the output.

I use a similar technique to determine things like PGP Encryption status on computers. Run a command line, parse the results and write the data you want to keep to a BigFix Client Setting(s).

EDIT: SORRY, Just realized I don’t see how to exclude files with this utility, but the description indicated it would. Apparently only via the GUI. I don’t see how to do it from the Command Line.

I think you could possibly short-circuit walking down the AppData folders by using ‘descendant folders’ rather than ‘descendants’, and filter out the AppData and cache folders before checking their file sizes.

q: sum of sizes of files whose (name of it as lowercase does not end with "dmg" and name of it as lowercase does not end with "vmwarevm") of descendant folders whose (pathname of it as lowercase does not contain "appdata" and pathname of it as lowercase does not contain "cache") of folder "c:\users" /1048576
A: 3226
T: 16043.390 ms
I: singular integer
1 Like

BOOM. Thank you sir!

Just remember that QnA time of 16043.390ms becomes 802169.5ms on the client (50 times slower by default) so caveat emptor