On 05/12/2018 17:02, Eduard Bloch wrote: > Hallo, > * OmegaPhil [Tue, Dec 04 2018, 10:32:27PM]: >> On 04/12/2018 22:12, Eduard Bloch wrote: >>> Hallo, >>> * OmegaPhil [Mon, Dec 03 2018, 04:28:36PM]: >>>> Package: apt-cacher-ng >>>> Version: 2-2 >>>> Severity: wishlist >>>> >>>> Please can apt-cacher-ng implement an optional size cap on the caching >>>> directory, so that I can (for example) guarantee it will never go above >>>> 100GB. >>> >>> Oh, "guarantee" is such a strong word. If you wish guarantees, please >>> configure your filesystem with hard quotas (you can set the filter on >>> the user name "apt-cacher-ng"). And you can have this today. >>> >>> In future, I might add this as an application feature but only if this >>> is not likely to add lots of complexity (to implement and at runtime). >>> >>> Best regards, >>> Eduard. >> >> >> Guarantee as in a few megs over limit is irrelevant, but the piece of >> mind that apt-cacher-ng will only use the rough amount specified, >> without having to set up a dedicated partition etc. >> >> Hmm, with hard quotas (not something I've investigated into yet), would >> apt-cacher-ng understand to start removing old packages when it hits the >> quota limit? (If not, presumably it would prevent caching anything new, >> which would probably defeat the purpose of the cacher for my usage). > > Uhm, no, of course not, and I don't like the idea of doing this online. > But you can do that offline with acngtool, and this could be run in a > cron job as well. However, the shrink function in 2-2 could overlook > some garbage data, but you still could give it a chance. > > If it does the job, please close this issue, thanks. > > $ /usr/lib/apt-cacher-ng/acngtool shrink > USAGE: acngtool shrink numberX [-f | -n] [-x] [-v] [variable assignments...] > -f: delete files > -n: dry run, display results > -v: more verbosity > -x: also drop index files (can be dangerous) > Suffix X can be k,K,m,M,g,G (for kb,KiB,mb,MiB,gb,GiB) > > Best regards, > Eduard.
Thanks for telling me about acngtool - /usr/lib/apt-cacher-ng/acngtool shrink 100GB -f gets the cache down to 102GB, which is OK (and better than me hacking a shitty bash script together to blindly purge things). I agree there is no pressing need for online shrinking then - I will close the ticket.
signature.asc
Description: OpenPGP digital signature