Unison
- If you can
ssh
into the server then Unison should work. - Install the same version on the client and on the server.
To sync the contents of dir b
into dir a
:
unison -batch -color true <dir-a> ssh://<user>@a<host>/<dir-b>
Setup
- Download the binary file with
wget
chmod +x <file>
- copy the executable somewhere on your path like
/usr/local/bin
unison -doc tutorial
>remote method
>remote shell method
- use a filewatcher to sync on change, or use cron to sync every n minutes
You can also use unison to sync files on the same computer.
References
Background
Recently I needed to work on a codebase that was on a remote machine whilst still using my local workflow and developer tools.
Vim's built in scp://
functionality isn't versatile enough - i wanted to use fzf.vim
to search for text across the code base. This led me to rsync
, sshfs
, and eventually unison
.