fgrehm / vagrant-cachier

Caffeine reducer
http://fgrehm.viewdocs.io/vagrant-cachier
MIT License
1.07k stars 111 forks source link

Support for setting a custom path for cache scope root #87

Closed fgrehm closed 1 year ago

fgrehm commented 10 years ago

As someone who recently moved to a 128GB SSD HD, I'd like to keep all of the cached packages on a single place regardless of the cache scope used so that I can easily spot where my disk space went and clean things up when needed. It'll also make my life easier when performing automated backups since I won't have to worry about excluding cachier cache directories.

This is also useful for those who runs Vagrant from within Dropbox folders and need to use the machine scope as they can save on storage by placing the cache outside of Dropbox.

fgrehm commented 10 years ago

Ok folks, I've been experiencing with placing cached packages under a subdirectory of host's /tmp by default on another project and I'm leaning towards making that the default behavior for vagrant-cachier as well.

The reason behind that is because it's pretty easy to forget about cached packages for old base boxes / projects that might end up wasting A LOT of disk space. By making it default to /tmp, the OS should take care of cleaning it up on shutdown and people like me that is short on disk space won't have to open Ubuntu's Disk Usage Analyser to find out where my disk space has gone.

Is there anyone out there against this change?

tuminoid commented 10 years ago

:-1:

I'd hate it. I'd so hate to lose all my caches over a reboot. For example, I have say 5 different environments set up and cached, and I go travelling. Now for some reason machine crashes or has to be booted (OSX stability is a joke), boom, all five caches are gone.

At least make the location configurable so people can enable or disable it on will.

mindreframer commented 10 years ago

I'm also for configurable settings. I'm comfortable maintaining my cache manually, if required. So, wasting a lot of diskspace is a non-issue for me. An opt-out configuration for people who want to keep their caches after a reboot. Something like: keep_cache_after_reboot = true. :)

tuminoid commented 10 years ago

I'd dare to say it should be otherwise around: keep the caches unless you have some setting on. It defeats the whole purpose of a cache if its gone every time you reboot or crash your machine.

fgrehm commented 10 years ago

@tuminoid @mindreframer Thanks for the input :smiley:

I probably didn't make myself clear but the idea is really to have a config for setting where vagrant-cachier places cache packages on the host. I'm willing to add an option for setting the root of cache buckets but I'm thinking about making it default to /tmp/vagrant-cache (but only when bumping to 1.0 since it's a pretty "invasive" change). You would still be able to use the current behavior and set it globally for all your projects from your ~/.vagrant.d/Vagrantfile.

I still haven't made my mind yet but I guess I might be alone on this since my use cases these days are a lot simpler than it used to be. I don't spend as much time recreating machines that I used to and I end up having a whole lot of packages just sitting around without any use for long periods of time wasting disk space.

fgrehm commented 1 year ago

Hey, sorry for the silence here but this project is looking for maintainers :sweat_smile:

As per https://github.com/fgrehm/vagrant-cachier/issues/193, I've added the ignored label and will close this issue. Thanks for the interest in the project and LMK if you want to step up and take ownership of this project on that other issue :wave: