Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do I use bake gc ? #31

Open
abailly opened this issue Sep 29, 2015 · 4 comments
Open

How do I use bake gc ? #31

abailly opened this issue Sep 29, 2015 · 4 comments

Comments

@abailly
Copy link
Contributor

abailly commented Sep 29, 2015

It is not clear to me which arguments to pass and what they mean...

@ndmitchell
Copy link
Owner

Take a look at https://github.com/ndmitchell/bake/blob/master/src/Development/Bake/Core/GC.hs#L20, which exports a function garbageCollect, and explains its arguments. Running that every 20 minutes in a loop seems reasonable. I don't call bake gc anymore, just garbageCollect directly, but looking at the command line arguments should give you a clue what bake gc does, once you know garbageCollect.

As an example, garbageCollect (20*1024*1024*1024) 0.20 (5*60*60) ["."] will make sure there is 20Gb free, there is 20% of the drive free, and it will only delete things over 5 hours old.

@abailly
Copy link
Contributor Author

abailly commented Sep 29, 2015

OK. I actually looked at it but was expecting to be able to run it as an external command so that I can schedule it in a cron for example. Given that I run server and client in a docker container, I was having trouble understanding how bake gc could work without connecting to server... There seemed to be missing a --server argument which bake client uses.

So IIRC I should put it somewhere in my server, e.g. like a thread or something and not try to use it as an external command?

@ndmitchell
Copy link
Owner

bake gc works on the client or the server - it will GC whichever disk you run it on - we currently do both server and client. Running it as a thread in your server is a good approach.

@abailly abailly closed this as completed Oct 1, 2015
@ndmitchell
Copy link
Owner

I'll leave this issue to document how to do it - the information from this ticket should be duplicated somewhere.

@ndmitchell ndmitchell reopened this Oct 4, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants