Identify old cached uploads that are obsolete

Does anyone have a webreport that would detect files uploaded to \Uploads" on the BES Root server that are no longer used in any fixlets, so I can delete them? I see the Cache Management dashboard in BigFix Labs does just that, but there is no filter button > select all - to select the 10’s of hundreds of files that should be deleted, and selecting each one individually is a major pain.

thanks

1 Like

+1 I would love to be able to select ‘all’ of the deleted ones with one click versus clicking hundreds/thousands of check boxes.

Hi,

So an important thing to understand is that the cache management dashboard does not handle the /uploads folder, it handles the relay sha1 cache. Cleaning the relay cache does nothing for you – the relay cache rotates automatically and all you get out of manually cleanup is begging for cache thrashing.

What you seem to be looking for is a way to clean up the uploads directory – The upload manager service has a method for handling this but it isnt foolproof – as a result, C3 Platform Kickstart has some session relevance that can help you achieve this goal simply enable the Analysis, “BigFix Server - Uploads - Windows” in C3 Platform Kickstart and run the linked session relevance and it should provide a list of unused uploads.

As always when taking code from strangers do a spot check and make sure you’re not deleting anything that is important. Always backup the files first before deleting.

You can use this list in combination with a batch script or powershell script to clean out the uploads directory of unused files.

Bill

4 Likes

ah, i always thought it was /Uploads, but that’s good to know. I wish things like this were part of the default BES platform, but i’ll give your link a try.
thanks

1 Like

Wow… Thank you @strawgate… That worked perfectly… RFE to include this in future release is in order I think :wink:

1 Like

Here it is: https://www.ibm.com/developerworks/rfe/execute?use_case=viewRfe&CR_ID=65708

It is Planned for Future Release.

Upvote, upvote, upvote!

Server error 500 :frowning:

doh!, getting other feedback on that as well. one moment …

Confirmed it is correct link and works for me.

Clear browser cache and try again.

@strawgate, why is the session relevance looking for reference to uploads as
matches (regex "(\:|%22)([0-9a-fA-F]{40})( |%22)")
and not
matches (regex "/(Uploads|uploads)/")

when i ran a query searching for “/Uploads/”, it came back with more entries than the earlier one.

a follow up on your reply

is there a tool to deleted obsolete fixlets in the SHA1 folder ??

The analysis pulls the hashes of the files in the Uploads directory of the bigfix server, the regex pulls the hashes out of the actionscripts of Fixlets. The session relevance then compares those two lists giving you the list of uploads that can be safely deleted.

1 Like

you can follow the instructions provided in this thread, copy the list to a text editor and insert remove-item or del infront of every hash and run that.

but there must be thousands of fixlets to remove, can it no be run using the database itself ??

It does not provide a list of Fixlets to remove, it provides a list of files in the /Uploads/ directory of the BigFix server that can be removed to clean up space. As a result, you cannot run something against the database.

@strawgate, when I try to run the session relevance, I get “Error: Singular expression refers to nonexistent object.” I noticed another user on GitHub reported the same issue, but I didn’t see a resolution. Do you have any recommendations? I do have the analysis running and it is reporting data properly.

Did you activate and import the analysis?

Yes, I did import the analysis.

Can you run this relevance and make sure it doesn’t error (and that it returns a number)?
number of (scripts of actions of bes fixlets;action scripts of bes actions;scripts of actions of components of component groups of bes baselines;action scripts of member actions of bes actions;(values of shared variables of it; values of private variables of it) of bes wizards)

And then try running this relevance and make sure that it doesn’t error and returns data:
(tuple string item 0 of it, tuple string item 1 of it) of values of results of property 1 of bes fixlets whose (name of it is "BigFix Server - Uploads Directory - Windows")

The first set returns a number. The second set returns “Error: Singular expression refers to nonexistent object.” instead of data.

If I drop "(tuple string item 0 of it, tuple string item 1 of it) of " and just query “values of results of property 1 of bes fixlets whose (name of it is “BigFix Server - Uploads Directory - Windows”)”, that returns a list of package names and hashes as expected.

Scanning through the list, I see some anomalies which are probably causing it to fail.

00afcc33254cb2cb67d502953ea6ba70bfb0eb32, ( 56644b446cd5bd60db4a3ae8b3406334d05f013e, b22eeecdb8a285d1d9113b4b4377ba551e214293, CAFBF33CECB044FAB5516C2E59D65BCD0B16DA87, dontallowie8reg.tmp )

or

a hash without a package name.