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

The current 'polling' service process is inefficient and can be ineffective #1

Open
wrobelda opened this issue Dec 9, 2023 · 2 comments

Comments

@wrobelda
Copy link

wrobelda commented Dec 9, 2023

Hi,

You rely on running the brew service process every 10 hours. This means that any file created in-between the service runs may get backed up by TimeMachine. And since adding exclusions to TimeMachine does not retroactively remove them from the backup, it effectively renders the service ineffective for any new artifacts created in-between the runs. This gets exacerbated if Time Machine is configured to back up every hour.

Better approach would be to detect new files created in the paths observed and run TMBliss executable against the new file. launchd can actually be configured to do exactly that; see this for a pretty good explanation:
https://stackoverflow.com/questions/1515730/is-there-a-command-like-watch-or-inotifywait-on-the-mac

@wrobelda wrobelda changed the title The current 'polling' service process is inefficient and may not even work at all The current 'polling' service process is inefficient or ineffective Dec 9, 2023
@wrobelda wrobelda changed the title The current 'polling' service process is inefficient or ineffective The current 'polling' service process is inefficient and can be ineffective Dec 9, 2023
@wrobelda
Copy link
Author

wrobelda commented Dec 9, 2023

FYI, I am getting conflicting information on whether or not this approach works recursively.

EDIT: It doesn't. A solution would be to use https://github.com/emcrisostomo/fswatch
EDIT2: .. which also comes as a C++ library https://emcrisostomo.github.io/fswatch/doc/1.17.1/libfswatch.html/
EDIT3: ... and has Rust bindings: https://docs.rs/fswatch/latest/fswatch/

@Reeywhaar
Copy link
Owner

Thank you, I'll take a look. My use case is that I backup on external disk every week or so, so I do always run check manually before backup.

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

No branches or pull requests

2 participants