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

rclonesync + inotifywait + Dropbox Webhook = handcrafted local Linux Dropbox volume #68

Closed
bshensky opened this issue Nov 17, 2020 · 4 comments

Comments

@bshensky
Copy link

No issue, just want to contribute...

Rclonesync is the keystone of my local setup to allow for 2-way sync of a local volume with a Dropbox cloud account. The volume/cloud manages ~80k files at about 400Gb in size.

"Inotifywait" looks for local changes to the volume and, when seen, uses "at" to queue an rclonesync job 5-10 minutes into the future. This is done to allow any immediate file management work to cool down.

On the Dropbox side, a Webhook is established to ping a local Web server (with appropriate firewall rules, of course) when files change in the cloud. On change and Webhook "ping", the same rclonesync job as above is queued.

Rclonesync jobs can only happen "on the fives". This guarantees that multiple concurrent sync requests (from either inotifywait or the Webbook) can be disregarded after the first. It prevents unnecessary multiple spawns of rclonesync during the cooldown period.

Finally, while not absolutely necessary, I'm using the rclone "cache" plugin to overlay my Dropbox config. This dramatically increases rclonesync's performance on upload-to-cloud operations, but at the expense of Cloud volume concurrency (I have a 1 hour cache expiry on the "cache" plugin config). Dropbox Webhook initiated requests include a flag to ignore/purge/rebuild the cache as part of the download-from-cloud operations.

My control scripts are attached for your review.

Thank you for such a wonderful tool!

vault_rclonesync.zip

@cjnaz
Copy link
Owner

cjnaz commented Nov 19, 2020

This is awesome. There was a prior request for inotify support within rclonesync so as not to have to put it in a cron job. Since to make this work the cloud service would also have to provide inotify support. It looks like you've figured this out for Dropbox. I wonder about other cloud services, or perhaps a generic solution?
I propose that you create a repo in your github home and I'll post a link to it as an application. If you prefer, I'll add this to my repo but I'm not in a good position to support it.

@cjnaz
Copy link
Owner

cjnaz commented Nov 28, 2020

What do you think Brian?

@cjnaz
Copy link
Owner

cjnaz commented Dec 2, 2020

Added info to the README.md and posted the .zip file to this repo. Thanks Brian.

@bshensky
Copy link
Author

Apologies for the delay in response - thanks for handling with aplomb. I will create my own repo as you mentioned and will let you know when done.

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