Unison

From miki
Revision as of 17:05, 30 December 2015 by Mip (talk | contribs) (→‎Basic Profile)
Jump to navigation Jump to search

References


Unison also has built-in help:

unison -help               # Brief help
unison -doc topics         # Get list of details documentation
unison -doc all            # Get the whole manual

Alternatives to Unison

Basic usage

  • Synchronize two directories
unison <dir-a> <dir-b>
  • Selecting files to synchronize
    • Synchronize home directory, using Ignore facility to skip some files.
    • Create a subdirectory called shared, and synchronize that directory only.
    • (Linux only) Create a subdirectory called shared, with symbolic links to other local directories, and synchronize that directory only using follow (making symlink transparent).
    • Synchronize home directory as root, using -path switch on the command line:
      unison /home/username ssh://remotehost//home/username -path shared
      

      The -path option can be used as many times as needed, to synchronize several files or subdirectories:

      unison /home/username ssh://remotehost//home/username \
          -path shared \
          -path pub \
          -path .netscape/bookmarks.html
      

      These -path arguments can also be put in your preference file.

Configuration tips

  • On Samba / CIFS file system, ignore permissions:
perms = 0
In some cases, you also need to use the preferences dontchmod.
  • When running unison with ssh, uses servercmd if unison is not found in the path:
servercmd = /usr/bin/unison

Basic Profile

Here we assume that all profiles will include the default one. If not, a more complex solution is to create a file .unison/common-prefs, that would be included by all profiles, including the default one.

Here a basic setup to backup pen usb stick on Cygwin:

Compile from sources

TBC