Difference between revisions of "Unison"

From ArchWiki
Jump to: navigation, search
m (Configuration)
m (Usage)
Line 46: Line 46:
  
 
==Usage==
 
==Usage==
When your profile is setup you can start syncing:
+
Once your profile is set up, you can start syncing:
 
  $ unison <profilename>
 
  $ unison <profilename>
Or:
+
or using the GUI tool:
 
  unison-gtk2
 
  unison-gtk2
And select the profile. Unison has a nice interface where you can view the progress and changes.
+
and select the profile. Unison has a nice interface where you can view the progress and changes.
  
 
==External Links==
 
==External Links==
 
*[http://www.cis.upenn.edu/~bcpierce/unison/download/releases/stable/unison-manual.html#afterinstall Official User Manual and Reference Guide, Section "Running Unison"]
 
*[http://www.cis.upenn.edu/~bcpierce/unison/download/releases/stable/unison-manual.html#afterinstall Official User Manual and Reference Guide, Section "Running Unison"]

Revision as of 04:28, 25 October 2010

Unison is a file-synchronization tool for Unix and Windows. It allows two replicas of a collection of files and directories to be stored on different hosts (or different disks on the same host), modified separately, and then brought up to date by propagating the changes in each replica to the other.

Not only can Unison sync between Windows and Unix ( OSX, Solaris, Linux etc.) systems, it also unrestricted in terms of which system can be the host.

Common uses include syncing configuration files, photos, and other content.

Installation

# pacman -S unison

This provides a CLI and GTK+ 1 & 2 frontends.

Configuration

In order to use Unison, you need to create a profile. You can use the supplied GUI tool or you can manually create a profile in Template:Filename.

If you want to use the GUI configuration, run:

$ unison-gtk2

Otherwise, edit the default config file:

# nano ~/.unison/default.prf

First, define the root of what you want to sync:

root=/home/user/

Then, define the root of where to sync it to:

root=ssh://example.com//path/to/server/storage

Optionally, you can give arguments to SSH:

sshargs=-p 4000

Now you are going to define which directories and files to include in the sync:

# dirs
path=Documents
path=Photos
path=Study
# files
path=.bashrc
path=.vimrc

You can also define which files to ignore:

ignore=Name temp.*
ignore=Name .*~
ignore=Name *.tmp

For further references check the Unison documentation.

Usage

Once your profile is set up, you can start syncing:

$ unison <profilename>

or using the GUI tool:

unison-gtk2

and select the profile. Unison has a nice interface where you can view the progress and changes.

External Links