2014-03-23 20:16:18 +00:00
|
|
|
# Generic
|
|
|
|
|
|
|
|
This bucket is never enabled by default. You have to enable it explicitly like
|
|
|
|
this:
|
|
|
|
|
|
|
|
```ruby
|
|
|
|
Vagrant.configure("2") do |config|
|
|
|
|
config.cache.enable :generic, { :cache_dir => "/var/cache/some" }
|
|
|
|
end
|
|
|
|
```
|
|
|
|
|
2014-04-07 00:05:13 +00:00
|
|
|
The `:cache_dir` parameter is required. It specifies the directory on the guest
|
2014-04-13 20:17:26 +00:00
|
|
|
that will be cached under the "/tmp/vagrant-cache/generic" bucket.
|
2014-03-23 20:16:18 +00:00
|
|
|
|
2014-04-13 20:17:26 +00:00
|
|
|
You may enable more than one generic bucket by giving them different names,
|
|
|
|
like this:
|
2014-03-23 20:16:18 +00:00
|
|
|
|
|
|
|
```ruby
|
|
|
|
Vagrant.configure("2") do |config|
|
2014-04-13 20:17:26 +00:00
|
|
|
config.cache.enable :generic, {
|
|
|
|
"one" => { cache_dir: "/var/cache/one" },
|
|
|
|
"two" => { cache_dir: "/var/cache/two" },
|
|
|
|
}
|
2014-03-23 20:16:18 +00:00
|
|
|
end
|
|
|
|
```
|
|
|
|
|
2014-04-13 20:17:26 +00:00
|
|
|
In this case you get two buckets called "one" and "two" under the guest's
|
|
|
|
`/tmp/vagrant-cache` directory.
|
2014-03-23 20:16:18 +00:00
|
|
|
|
|
|
|
The Generic bucket is useful if you want to implement a caching mechanism by
|
|
|
|
hand. For instance, if you want to cache your wget downloads under
|
2014-04-07 00:05:13 +00:00
|
|
|
`/var/cache/wget` you can do this:
|
2014-03-23 20:16:18 +00:00
|
|
|
|
|
|
|
```ruby
|
|
|
|
Vagrant.configure("2") do |config|
|
2014-04-13 20:17:26 +00:00
|
|
|
config.cache.enable :generic, {
|
|
|
|
"wget" => { cache_dir: "/var/cache/wget" },
|
|
|
|
}
|
2014-03-23 20:16:18 +00:00
|
|
|
end
|
|
|
|
```
|
|
|
|
|
|
|
|
Then, you invoke wget like this:
|
|
|
|
|
|
|
|
```sh
|
|
|
|
wget -N -P /var/cache/wget URL
|
|
|
|
```
|