If that works, cd to your home directory, and synchronize the local a.tmp sub-directory to you home directory on the remote host: unison a.tmp ssh://remotehostname/a.tmp. Next, let's check that both SSH and Unison are running on the remote host by running ssh remotehostname unison -version.
Linux Setup Using Unison Installing OpenSSH Windows Setup Using Unison Clear-text connectionįor this mode, SSH is not needed. This also includes taking account the time zone parameter if the two hosts are not located in the same area. See Synchronizing hosts through NTP for more infos. Best thing to do is to test some sample cases yourself.Unison is an open-source alternative to Rsync.Īlthough Unison uses the local host's clock to check whether a file has been modified, and hence, is not affected if the local and remote hosts' clocks are not in sync, you might want to ensure that they are. Most tool's documentation usually isn't very clear or precise about this. If you missed the slash at the destination dir above, it will wipe out all dirs in the destination. For example, in rsync, the following: rsync -r -v -t -delete -rsh= "ssh -l xah" ~/Documents ~/web ~/Pictures ~/ErgoEmacs_Source ~/Shared ~/cinse_pixra3 you added a slash in one of the source dir, the dir won't be copied over but only their children, resulting spam in the top level destination dir, or overwriting dirs of the same name. However, for some tools it has different meanings, and their meanings may not be the same. Also, it makes a difference whether it is the source dir or destination dir.įor a example discussion of different semantics of this, see: Idiocy Of Unix Copy Commandįor many language and tools, with a slash or without a slash at the end means the same thing. WARNING: It is important to know whether directory path should end in a slash or not. If you want to ignore file permissions, you can use -perms 0 Dir Ending in Slash or No? When syncing among Windows and Unix, sometimes it is a pain to deal with permissions because they are different. You can use the “-ignore” option to ignore Mac's DS_Store file or emacs “*~” files. You might checkout the option “-unicode”. So, if you have files with Chinese chars, math symbols, etc, Unison will still work but the result file name will be gibberish. Note that Unison as of version 2.27, it may have problems with file names containing Unicode chars.
Syncing my PC and Mac: unison -servercmd /usr/bin/unison c:/Users/xah/web you are syncing from Mac and Windows, you many want to add -rsrc false, which will ignore resource fork and file type info. DS_Store" tells it to ignore the Mac's temp file “.DS_Store”.
DS_Store" this server, it contains works done by other people, so i can't just update it one-way with rsync. I use it for syncing my local files and a remote server, both running OS X: unison -servercmd /sw/bin/unison ~/uci-server/vmm -ignore "Name. Here are some examples of commands that i actually use.
Usually, you install multiple versions of Unison on the same machine.
Unison lets you sync files in both directions across 2 machines.