3 ms·
Your story is very familiar to me, including trying and failing to use Dropbox due to terrible symlink-handling! I built something similar recently [0] (also a
by dantillberg 11y ago
Your story is very familiar to me, including trying and failing to use Dropbox due to terrible symlink-handling!
I built something similar recently [0] (also a bit like Sparkleshare, which I just learned about from another comment in this thread...), but for me I needed to sync all of my source code between multiple machines. You can't do that with stock git, but I was able to s/git/gut/gi to make "gut" (which uses .gut folders to store its own state and will happy gut-add files inside .git subfolders) and now I have a "~/work" folder on my laptop, on my desktop, and on a dev box on AWS, with all of my source code synced in real-time.
I also wrote much the same thing in Node and also in Python before rewriting (again) to Go. You can peruse my Python code at [1] if you're curious. I used plumbum (awesome library) for executing local/remote commands (makes it a bit simpler than using subprocess and calling ssh with shell commands). Also, you can use inotifywait with the "--monitor" option which makes it keep running when there are changes; you have to then parse out what changed, and make sure you handle state correctly, but that way you don't miss changes made while inotifywait starts back up again.
[0]: https://github.com/tillberg/gut https://github.com/tillberg/gut
[1]: https://github.com/tillberg/gut/tree/0ce233d44f7f55448c1541147c01136f0b28fa5f/gut https://github.com/tillberg/gut/tree/0ce233d44f7f55448c15411...
- prashanthellina 11y agoVery cool! I wish I'd found your repo before writing my implementation. In fact, I was going to rewrite mine in Golang to reduce memory consumption on my back-up server. I will take yours for a spin.
- rakoo 11y ago> What would happen if you took git, sed, rsync, and inotify, and you mushed and kneaded them together until smooth? You'd get unison (https://www.cis.upenn.edu/~bcpierce/unison/ https://www.cis.upenn.edu/~bcpierce/unison/) :)