Hello --
Can someone clarify the how best to clear up stale flyweight directory entries that are no longer needed and what the process might be?
We're running low on diskspace. This effects among other things artifact storage. I know I can mount a new volume and use that just for artifacts which I might still consider, but it would be nice to continuously keep the flyweight directory pruned of things GoCD no longer needs.
I *think* what's happening is that we unfortunately have some large repositories, and developers are modifying their pipelines to point to different branches. If I understand correctly, this doesn't clean up the old flyweight directories
My theory is that maybe I can find all the .git/config files that haven't been accessed in 30 days and then maybe delete their flyweight directory. Something like this:
cd /var/lib/go-server/pipelines/flyweight
find . -maxdepth 3 -path "*/.git/index" -atime +365|cut -d'/' -f 2|xargs -I{} rm -rf {}
find would produce paths like this:
./51201307-d704-4434-a8db-2109a86a19db/.git/index
and the subequent cut produces a list like:
51201307-d704-4434-a8db-2109a86a19db
...
and then I pipe that list to rm -rf
I could possibly capture this in a cron job to run periodically.
Is this a viable strategy?
If I delete this directory but GoCD has a pipeline that suddenly needs to create the same hashed flyweight again would it just work?
If not, can someone share some recommendations on how best to approach this?
thanks.
Doug