Difference between revisions of "Unison"

From ArchWiki
Jump to: navigation, search
m (clarification)
m (formal: no "we"s)
Line 17: Line 17:
 
If you want to use the GUI, run:
 
If you want to use the GUI, run:
 
  $ unison-gtk2
 
  $ unison-gtk2
Else edit the default config file:
+
Else, edit the default config file:
 
  # nano ~/.unison/default.perf
 
  # nano ~/.unison/default.perf
  
First we define the root of what you want to sync:
+
First define the root of what you want to sync:
 
  root=/home/user/
 
  root=/home/user/
  
Then we define the root where we sync it too:
+
Then define the root where sync it too:
 
  root=ssh://example.com//path/to/server/storage
 
  root=ssh://example.com//path/to/server/storage
 
Optionaly, you can give arguments to ssh:
 
Optionaly, you can give arguments to ssh:
 
  sshargs=-p 4000
 
  sshargs=-p 4000
  
Now we are going to define with directories and files we want to include in the sync
+
Now you are going to define wich directories and files to include in the sync
 
  # dirs
 
  # dirs
 
  path=Documents
 
  path=Documents

Revision as of 19:38, 10 November 2009

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 also provides the Unison GTK2 frontend.

Configuration

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

If you want to use the GUI, run:

$ unison-gtk2

Else, edit the default config file:

# nano ~/.unison/default.perf

First define the root of what you want to sync:

root=/home/user/

Then define the root where sync it too:

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

Optionaly, you can give arguments to ssh:

sshargs=-p 4000

Now you are going to define wich 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

When your profile is setup you can start syncing:

$ unsion <profilename>

Or:

unision-gtk2

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

External Links