
Show HN: Sshync – Auto-sync files over SSH - megalodon
https://github.com/mateogianolio/sshync
======
beagle3
This is a nice little project, but I think rsync is better suited for any
serious use. It can do ssh, it's own protocol or any connection program that
would tunnel bidirectionally. It does very efficient transfer, can create off-
line patch files, and basically do any one-way file/dir sync function you can
think of.

Edit: this one is continuous and rsync is one-shot. Personally, I've been
using inotify+rsync+timeout (intofy+rsync has a race condition, so limiting
the inotify wait and syncing anyway is essential). Does sshync avoid the race?

~~~
mynegation
I use similar solution: my own shell script with inotify + timeout + unison
over ssh. Unison is much better suited for two-way synchronization than rsync.

~~~
larrys
For
[http://www.cis.upenn.edu/~bcpierce/unison/](http://www.cis.upenn.edu/~bcpierce/unison/)
your thoughts on why that is better than using rsync ?

Edit: I am now noticing this tool isn't even maintained anymore.

~~~
rsync
Larry - would you please email us at info@rsync.net ? We have a few items to
discuss with you ...

(your profile mentions to respond to one of your comments if someone needs to
reach you ...)

~~~
larrys
Thanks - I will but not just yet (a few reasons for that actually).

------
deckard1
These are some pretty awful scripts, to be honest. Use Unison
([https://www.cis.upenn.edu/~bcpierce/unison/](https://www.cis.upenn.edu/~bcpierce/unison/)).
Syncing is much more dangerous and difficult than people assume.

------
electrum
There is a standard tool, ssh-copy-id, that does the job of sshpair.

~~~
raimue
This sshpair is actually quite dangerous as it simply overwrites your existing
key.

~~~
merlincorey
Yeah I was just complaining about that elsewhere. It's a further symptom of
the fact this whole project is reinventing wheels, badly.

------
yaur
I use lsyncd for this. Why would I switch?

~~~
roeme
(We do as well). From what I see, the only advantage this offers over lsyncd
is that Windows is supported.

------
pepve
There's also sshfs:
[https://en.wikipedia.org/wiki/SSHFS](https://en.wikipedia.org/wiki/SSHFS)

~~~
beagle3
Note however that sshfs makes a file system available through ssh (with Some
caching but not e.g. persistent cache across ssh reconnects), and no off-line
persistence - whereas other solutions discussed (sshync, unison, lsync,
syncthing) all replicate files (think dropbox) which comes with benefits
(quicker access, offline availability) and problems (edit conflicts, stale
versions)

------
megalodon
Hey.

I appreciate the positive response, but this is just something I put together
quickly and needs a little refurbishing before it can be considered a viable
alternative to something like lsyncd.

Top priorities right now are to get rid of ssh-client dependency and to
address security concerns. I'd also like to implement file diffing.

Your feedback is invaluable!

~~~
vitd
This is a small thing - but how do you pronounce the name? Looking at it, I
want to call it "ssh sync", but it looks more like it should sound like
"shync" (which sounds sort of like Garth from "Wayne's World" saying
"schwing!") Just curious because it's hard to discuss a tool verbally if I
don't know how to pronounce it.

~~~
megalodon
I'd go with "ssh sync".

------
nickysielicki
See also:
[http://syncmaildir.sourceforge.net/](http://syncmaildir.sourceforge.net/)

This is how I do my email, exim running on a DO instance and I send and
receive to my laptop via ssh.

------
adontz
On Windows I use WinSCP, from menu "Commands\Synchronize" and "Commands\Keep
Remote Directory up to Date", or from scripting "synchronize" and
"keepuptodate".

------
np422
Why not use the existing rsync over ssh and ssh-copy-id?

I think newline is valid in filenames in most *nix filesystems, so the
possibility to use an alternative RS would be nice.

------
pandada8
What's difference between this one and rsync？

~~~
LukeShu
It looks to me that this keeps running "in the background" and watches for
changes; syncing things as they happen. Rsync can't do that.

~~~
vidarh
rsync can however take a file list, and inotifywait can produce a file list
with the help of awk or sed. Which means you can achieve continuous
synchronisation with ~5 lines of shell script. A bit more care if you want to
sync two ways.

I've found that my file syncing needs tends to be so varied that most of the
dedicated tools I've looked at have almost always been just wrong enough not
to be worth it compared to just composing something with rsync and
inotifywait.

Of course your mileage will vary.

------
felipellrocha
I pronounced this 's-shync' in my head. I am happy.

