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

Block package managers' cache directories #58

Open
stevegrunwell opened this issue Jun 18, 2020 · 6 comments
Open

Block package managers' cache directories #58

stevegrunwell opened this issue Jun 18, 2020 · 6 comments

Comments

@stevegrunwell
Copy link
Owner

Package managers will typically create a cache directory in order to prevent the same packages from being downloaded over and over again. For example, Composer will store these in ~/.composer/cache.

Since these too are development dependencies that can easily be restored, they should be omitted from Time Machine backups.

Tool Cache Directory
Bundler ~/.bundle/cache
Composer ~/.composer/cache
npm ~/.npm/_cacache
nvm ~/.nvm/versions
Yarn ~/.yarn-cache

It's worth noting that these are often configurable, so if the given tools are available we may want to try to query their configurations.

What other cache directories are hiding out in our home directories?

@muuvmuuv
Copy link

Would it be worth also ignoring .cache in projects? Some tools like GatsbyJS use them.

@stevegrunwell
Copy link
Owner Author

I'd say we should absolutely ignore those, but I'm wary of ignoring all .cache directories, since someone could have a .cache directory that has nothing to do with Gatsby.

Is there a dependency file that we might be able to look for to ensure we're only blocking caches that can be re-created?

@muuvmuuv
Copy link

muuvmuuv commented Jun 20, 2020

Using gatsby requires a gatsby-config.js in the project root or at least it is needed to setup gatsby properly, never tried or read that it is not needed: https://www.gatsbyjs.org/docs/api-files-gatsby-config/

Gatsby also generates static files in public so those can be ignored as well, just in case of gatsby.

@TheNoim
Copy link

TheNoim commented Jul 11, 2020

but I'm wary of ignoring all .cache directories, since someone could have a .cache directory that has nothing to do with Gatsby.

But why do you need any kind of cache in your time machine? I would suggest excluding all cache like directories.

@Clashsoft
Copy link
Contributor

Some additions:

Tool Cache Directory
pnpm ~/.pnpm-store
Gradle ~/.gradle/caches, ~/.gradle/wrapper

@tomtastic
Copy link

tomtastic commented Apr 4, 2021

What about Go paths also, which seems to have caused at least one Timemachine restore problem : https://twitter.com/thisdougb/status/1378390726950617091?s=20

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants