pruning the flyweight directory

130 views
Skip to first unread message

dle...@gmail.com

unread,
Sep 28, 2021, 1:36:57 PM9/28/21
to go-cd

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

Ketan Padegaonkar

unread,
Sep 28, 2021, 2:46:12 PM9/28/21
to go...@googlegroups.com
It is perfectly safe to delete any of the repositories under the flyweight directory.

--
You received this message because you are subscribed to the Google Groups "go-cd" group.
To unsubscribe from this group and stop receiving emails from it, send an email to go-cd+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/go-cd/c54f49dd-ebd6-4231-b9d4-e87c228ffcbfn%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages