Trying to exclude a directory from descendants search

I have a property that currently scans all machines that contain a P: drive and report back any directory that is least 1MB of data. It works fine, but I am trying to exclude p:\temp from my results with no luck. Here is my current property:

((pathnames of it, ((size of it)/1000000) as string & " MB") of descendants of folder “P:”) whose (substring before " MB" of (item 1 of it) as Integer > 0)

Any ideas on how to get "pathnames of it whose (name of it does not contain “p:\temp” as lowercase) into this relevance and have it work properly?

I have tried it many ways in Q&A with no success…

Thanks for any suggestions.
Scott

This will not give you directories containing at least 1mb, this will give you files of at least 1mb, which does not sound like what you want.

See this:

(pathname of it, size of it / (1024*1024)) of descendants whose(size of it > 0 AND pathname of it as lowercase does not start with "p:\temp\") of folder "P:\"

See related posts:

Jgstew,

Thanks for the quick reply, but the file data is too much.

Currently the excel report looks like this and I was trying to clean it up more:

Thanks,
Scott

So you want the size of the directories, not the files?

Should a parent folder include the size of all files and subfolders, or just the files within that directory itself?

In your original question, you said you wanted sizes of the directories, but the relevance snippet you provided was getting the size of files, not the directories, so it was not clear which you were looking for.

Also, I feel I need to point out that using the descendants inspector can be very slow and problematic in some use cases.

Sorry, I wasn’t clear, yes I just want size of directories greater than 1MB. I agree about descendants being slow, but since I am only scanning the P: drives and they only exist in our environment for Terminal Servers it really isn’t that much to go through. We have had issues with our P: drives filling up and I was trying to determine the culprits.

“Should a parent folder include the size of all files and subfolders, or just the files within that directory itself” I believe just the parent folder…if its big enough to be of concern, I could have our field services group track it down. I am just trying to keep the excel report columns small and readable. Too much data in my reports always keeps them from being used effectively around here :smile:

1 Like

Thanks jgstew, I setup your relevance and upped the size number to 1000 and the report is perfect, showing just the offenders…Thanks again for your help!!

Scott

This will give you the folders containing files that total over a certain size:

(pathname of it, sum of sizes of files of it) whose(item 1 of it > 1 * 1024 * 1024) of descendant folders whose( pathname of it as lowercase does not start with "p:\temp\" ) of folder "P:\"

Wow that was fast, thanks for you effort!

I am getting some different info from Q&A on a server with P: drive vs whats returned on the property in BigFix:

My original:

q: ((pathnames of it, ((size of it)/1000000) as string & " MB") of descendants of folder "P:\") whose (substring before " MB" of (item 1 of it) as Integer > 0)

A: P:\pagefile.sys, 4294 MB
A: P:\temp\com.bmc.patrol.patsdk.rsm.messageworkers.SolutionResolvedWorker1437838876073299459.tmp, 1 MB
A: P:\temp\com.bmc.patrol.patsdk.rsm.messageworkers.SolutionResolvedWorker7913561937873263406.tmp, 1 MB
A: P:\temp\IRG7B.tmp\PersistedStore\MpPersistedStore.bin, 7 MB
A: P:\temp\KB2729449_20121121_001221956-Microsoft .NET Framework 4 Client Profile-MSP0.txt, 10 MB
A: P:\temp\KB2736428_20130109_231551031-Microsoft .NET Framework 4 Client Profile-MSP0.txt, 11 MB
A: P:\temp\KB2736428_20130109_231551031-Microsoft .NET Framework 4 Extended-MSP1.txt, 2 MB
A: P:\temp\KB2737019_20121121_001521531-Microsoft .NET Framework 4 Client Profile-MSP0.txt, 10 MB
A: P:\temp\KB2742595_20130109_214529389-Microsoft .NET Framework 4 Client Profile-MSP0.txt, 11 MB
A: P:\temp\KB2742595_20130109_214529389-Microsoft .NET Framework 4 Extended-MSP1.txt, 2 MB
A: P:\temp\KB2789642_20130214_001032292-Microsoft .NET Framework 4 Client Profile-MSP0.txt, 12 MB
A: P:\temp\KB2804576_20130516_012930008-Microsoft .NET Framework 4 Client Profile-MSP0.txt, 13 MB
A: P:\temp\KB2832407_20130710_213525615-Microsoft .NET Framework 4 Client Profile-MSP0.txt, 13 MB
A: P:\temp\KB2835393_20130710_221444488-Microsoft .NET Framework 4 Client Profile-MSP0.txt, 14 MB
A: P:\temp\KB2840628v2_20130814_195947224-Microsoft .NET Framework 4 Client Profile-MSP0.txt, 15 MB
A: P:\temp\KB2840628_20130710_225020585-Microsoft .NET Framework 4 Client Profile-MSP0.txt, 14 MB
A: P:\temp\KB2858302v2_20131010_034055572-Microsoft .NET Framework 4 Client Profile-MSP0.txt, 16 MB
A: P:\temp\KB2858302v2_20131010_034055572-Microsoft .NET Framework 4 Extended-MSP1.txt, 2 MB
A: P:\temp\KB2861188_20131014_214708373-Microsoft .NET Framework 4 Client Profile-MSP0.txt, 16 MB
A: P:\temp\KB2898855v2_20140212_201511022-Microsoft .NET Framework 4 Client Profile-MSP0.txt, 17 MB
A: P:\temp\KB2901110v2_20140212_203019412-Microsoft .NET Framework 4 Client Profile-MSP0.txt, 17 MB
A: P:\temp\KB2901110v2_20140212_203019412-Microsoft .NET Framework 4 Extended-MSP1.txt, 3 MB
A: P:\temp\KB2931365_20140514_193022867-Microsoft .NET Framework 4 Client Profile-MSP0.txt, 18 MB
A: P:\temp\KB2972106_20141016_013731973-Microsoft .NET Framework 4 Client Profile-MSP0.txt, 20 MB
A: P:\temp\KB2972215_20140910_231644303-Microsoft .NET Framework 4 Client Profile-MSP0.txt, 19 MB
A: P:\temp\KB2978125_20141112_234655164-Microsoft .NET Framework 4 Client Profile-MSP0.txt, 20 MB
A: P:\temp\KB2979575v2_20141016_013050832-Microsoft .NET Framework 4 Client Profile-MSP0.txt, 19 MB
A: P:\temp\KB3023221_20150513_220111430-Microsoft .NET Framework 4 Client Profile-MSP0.txt, 22 MB
A: P:\temp\KB3032662_20150513_220503239-Microsoft .NET Framework 4 Client Profile-MSP0.txt, 22 MB
A: P:\temp\KB3037578_20150416_013652820-Microsoft .NET Framework 4 Client Profile-MSP0.txt, 21 MB
A: P:\temp\KB3037578_20150416_013652820-Microsoft .NET Framework 4 Extended-MSP1.txt, 3 MB
A: P:\temp\KB3048074_20150513_205830827-Microsoft .NET Framework 4 Client Profile-MSP0.txt, 21 MB
A: P:\temp\KB3072309_20150812_214124354-Microsoft .NET Framework 4 Client Profile-MSP0.txt, 23 MB
A: P:\temp\McAfeeLogs\MFEagent.msi.2014.08.07.18.26.15.log, 1 MB
A: P:\temp\Microsoft .NET Framework 3.5-KB2736416_20130110_043128400-Msi0.txt, 1 MB
A: P:\temp\Microsoft .NET Framework 3.5-KB2840629_20130711_004612640-Msi0.txt, 1 MB
A: P:\temp\Microsoft .NET Framework 3.5-KB2861697_20131010_073019225-Msi0.txt, 1 MB
A: P:\temp\MSI4578e.LOG, 3 MB
A: P:\temp\SEP12_INST.LOG, 1 MB
A: P:\temp\SEP_INST.LOG, 7 MB
A: P:\temp\WER1D66.tmp.hdmp, 2 MB
A: P:\temp\WER296A.tmp.hdmp, 2 MB
A: P:\temp\WER41E7.tmp.hdmp, 2 MB
A: P:\temp\WER57AF.tmp.hdmp, 2 MB
A: P:\temp\WER9FAE.tmp.hdmp, 2 MB
T: 41.332 ms

Too much info. So I move to your relevance:

q: (pathname of it, size of it / (1024*1024)) of descendants whose(size of it > 0 AND pathname of it as lowercase does not start with "p:\temp\") of folder "P:\"

A: P:$RECYCLE.BIN\S-1-5-21-2978336-1207586478-467891306-1105\desktop.ini, 0
A: P:$RECYCLE.BIN\S-1-5-21-2978336-1207586478-467891306-1274\desktop.ini, 0
A: P:$RECYCLE.BIN\S-1-5-21-2978336-1207586478-467891306-154585\desktop.ini, 0
A: P:$RECYCLE.BIN\S-1-5-21-2978336-1207586478-467891306-22221\desktop.ini, 0
A: P:$RECYCLE.BIN\S-1-5-21-2978336-1207586478-467891306-23824\desktop.ini, 0
A: P:$RECYCLE.BIN\S-1-5-21-2978336-1207586478-467891306-376035\desktop.ini, 0
A: P:\pagefile.sys, 4095
T: 39.795 ms

Much better, but to drop out the smaller size files I go to this:

q: ((pathname of it, size of it / (1024*1024)) as string & " MB") of descendants whose(size of it > 1000 AND pathname of it as lowercase does not start with "p:\temp\") of folder "P:\"

A: P:\pagefile.sys, 4095 MB
T: 38.814 ms

Ok data return looks good, from Q&A, but here is the data returned in BigFix:

And lastly, I have not setup you other property yet, but this is what it returns in Q&A:

q: (pathname of it, sum of sizes of files of it) whose(item 1 of it > 1 * 1024 * 1024) of descendant folders whose( pathname of it as lowercase does not start with "p:\temp\" ) of folder "P:\"

A: P:\temp, 461462817
T: 50.037 ms

Is this maybe because P:\temp is the only parent folder on the drive?

Thanks,
Scott

It seems like it is filtering out everything due to sizes being small, and filtering out all the subfolders of “P:\temp” but not “P:\temp” itself because it’s path doesn’t end in \

Try This:

(pathname of it, sum of sizes of files of it) whose(item 1 of it > 55 * 1024 * 1024) of descendant folders whose( exists (pathname of it as lowercase) whose( (it does not equal "p:\temp") AND (it does not start with "p:\temp\") ) ) of folder "P:\"

It didn’t return any data, because I am assuming that p:\temp was the only dir

q: (pathname of it, sum of sizes of files of it) whose(item 1 of it > 55 * 1024 * 1024) of descendant folders whose( exists (pathname of it as lowercase) whose( (it does not equal "p:\temp") AND (it does not start with "p:\temp\") ) ) of folder "P:\"

T: 39.076 ms

So I tried it on my C: drive swapping out the parameters and it did work, except it wasn’t listing results for all 25 folders, it returned values for 8 folders.

I appreciate all your time and I am not going to bug you anymore, I am going to use your relevance from above. It cleans up my report and gets rid of P:\temp data.

Thanks again for your help!
Scott

It would only return values for 8 folders if those are the only folders that contain files over the size: (55 * 1024 * 1024)

Ok, thanks for explanation!

Scott