Difference between revisions of "Unison"

From ArchWiki
Jump to: navigation, search
m (moved intro up front, formal)
Line 3: Line 3:
 
[[Category:Daemons and system services (English)]]
 
[[Category:Daemons and system services (English)]]
  
== Introduction ==
+
'''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.
  
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.
  
Unison works on Windows, Unix ( OSX, Solaris, Linux etc.) systems and you can sync with all platforms, like Windows laptop with Unix server.
+
Common uses include syncing configuration files, photos, and other content.
  
I use unison to sync dotfiles, photos with my laptop via my server.
+
==Installation==
 +
# pacman -S unison
 +
This provides the unsison GTK2 frontend.
  
== Installation ==
+
==Configuration==
pacman -S unison
+
In order to use unison you need to create an profile, you can do this with a GUI or by manually creating a profile in {{Filename|~/.unison}}.
This provides the unsison-gtk(2) package.
+
  
== Configuration ==
+
If you want to use the GUI, run:
In order to use unison you need to create an profile, you can do this the gui way or by creating an profile in .unison.  
+
$ unison-gtk2
 +
Else edit the default config file:
 +
# nano ~/.unison/default.perf
  
If you want to use the gui, run:
+
First we define the root of what you want to sync:
  unison-gtk2
+
  root=/home/user/
Else edit the default config file
+
vi(m) ~/.unison/default.perf
+
  
First we define the root of what you want to sync
+
Then we define the root where we sync it too:
root = /home/user/
+
  root=ssh://example.com//path/to/server/storage
 
+
Optionaly, you can give arguments to ssh:
Then we define the root where we sync it too
+
  sshargs=-p 4000
  root = ssh://example.com//path/to/server/storage
+
Optional you can give arguments to ssh
+
  sshargs = -p 4000
+
  
 
Now we are going to define with dirs and files we want to include in the sync
 
Now we are going to define with dirs and files we want to include in the sync
 
 
  # dirs
 
  # dirs
  path = Documents
+
  path=Documents
  path = Photos
+
  path=Photos
  path = Study
+
  path=Study
 
  # files
 
  # files
  path = .bashrc
+
  path=.bashrc
  path = .vimrc
+
  path=.vimrc
 
   
 
   
You can also define ignores
+
You can also define which files to ignore:
  ignore = Name temp.*
+
  ignore=Name temp.*
  ignore = Name .*~
+
  ignore=Name .*~
  ignore = Name *.tmp
+
  ignore=Name *.tmp
  
For further references check the unison [http://www.cis.upenn.edu/~bcpierce/unison/download/releases/stable/unison-manual.html#profileegs documentation]
+
For further references check the unison [http://www.cis.upenn.edu/~bcpierce/unison/download/releases/stable/unison-manual.html#profileegs documentation].
  
== Usage ==
+
==Usage==
 
When your profile is setup you can start syncing:
 
When your profile is setup you can start syncing:
  unsion <profilename>
+
  $ unsion <profilename>
 
Or:
 
Or:
 
  unision-gtk2
 
  unision-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==
 +
*[http://www.cis.upenn.edu/~bcpierce/unison/download/releases/stable/unison-manual.html#afterinstall Official User Manual and Reference Guide, Section "Running Unison"]
  
== Other Resources ==
+
*[http://www.endperform.org/2007/07/howto-backup-and-sync-with-unison/ HOWTO: Backup and Sync with Unison], ''[http://www.endperform.org endperform.org]''
[http://www.cis.upenn.edu/~bcpierce/unison/download/releases/stable/unison-manual.html#afterinstall manual]
+
[http://www.endperform.org/2007/07/howto-backup-and-sync-with-unison/ howto]
+

Revision as of 19:29, 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 provides the unsison GTK2 frontend.

Configuration

In order to use unison you need to create an profile, you can do this with a GUI or by manually creating 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 we define the root of what you want to sync:

root=/home/user/

Then we define the root where we sync it too:

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

Optionaly, you can give arguments to ssh:

sshargs=-p 4000

Now we are going to define with dirs and files we want 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