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

Does this work with hourly backups? #54

Open
poma opened this issue Mar 22, 2020 · 3 comments
Open

Does this work with hourly backups? #54

poma opened this issue Mar 22, 2020 · 3 comments

Comments

@poma
Copy link

poma commented Mar 22, 2020

By default Time Machine backups run around every hour, while asimov runs only daily. This likely means that Time Machine will include most dependency dirs during its run and only after that they will be excluded, while still remaining in backups.

It is possible to remove dependency dirs from backups retroactively but I think a better solution would be to wrap Time Machine into asimov as described in this answer. This will allow asimov to start before each Time Machine backup and have a chance to modify exclusion list. It also needs to launch as a low priority background task like Time Machine does so as not to interfere with what user is doing.

// Another approach I'm considering (instead of error-prone asimov setup) is to wrap npm install and similar commands such that they add an exclusion to Time Machine when they are ran.

@poma
Copy link
Author

poma commented Mar 24, 2020

I've made a simple wrapper implementation as described in the last paragraph gist that adds new exclusions when you use npm or cargo. Any thoughts on this approach?

@stevegrunwell
Copy link
Owner

First, thanks for bringing up this excellent point. When building Asimov initially, I was so concerned with historical dev dependencies that I wasn't even thinking about those that would be installed in the future (which is odd, considering how often I'm spinning up new projects).

While I think the wrappers you wrote for npm and cargo are extremely clever, hooking into the bootstrap of Time Machine itself is probably the most sensible route; heck, if we're able to pull that off for all of the automatic background runs, we could do away with the scheduled Asimov run entirely 🤔.

Side-note: one of the coolest things about building a simple tool that benefits developers regardless of language is the number of awesome things we can collectively come up with 😄.

@muuvmuuv
Copy link

muuvmuuv commented Jun 8, 2020

You could also turn auto backups off and do it manually after each asimov run: https://apple.stackexchange.com/questions/148963/run-script-before-every-time-machine-backup

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

3 participants