[Collaborator][Cache] How do I remove old files from the server cache for Collaborator 9.5.9501?
Our server cache is getting large and I'd like to archive the old reviews and remove their files from the server. Archiving the old reviews is simple (Select the review and press "SAVE TO ZIP"). My problem is deleting the associated files from the server cache directory (<INSTALL_DIR>\tomcat\collaborator-content-cache).
I could only find one relevant message board topic (https://community.smartbear.com/t5/Collaborator/CodeReviewer-Archive-Reduce-content-cache-which-inflates-which/m-p/92774/highlight/true#M1076). The response was to manually review and remove old files/directories. Of course, because the file names are hashes, you have no idea what file associates with which review. So, this is really a brute force option that will have a lot of unintended consequences.
Does anyone have a better way to remove old server cache files? It would be especially nice if you can target files associated with a specific review.
I wrote the attached Perl script that archives the cache files for the input review number. It's smart enough to not remove files used by later reviews and will create a TGZ with all the files associated with the review. If you want to execute against a range of review, replace the (@ARGV) of the foreach loop with (1..n) to archive reviews 1 through n.