asimov icon indicating copy to clipboard operation
asimov copied to clipboard

Does this work with hourly backups?

Open poma opened this issue 4 years ago • 3 comments

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 avatar Mar 22 '20 19:03 poma

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?

poma avatar Mar 24 '20 17:03 poma

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 😄.

stevegrunwell avatar Jun 07 '20 18:06 stevegrunwell

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

muuvmuuv avatar Jun 08 '20 07:06 muuvmuuv