Difference between revisions of "Unison"

From Linuxintro
imported>ThorstenStaerk
(New page: = TroubleShooting = Warning: inconsistent state. The archive file is missing on some hosts. For safety, the remaining copies should be deleted. Archive ar12953235d4d7106b0880b8205...)
 
imported>ThorstenStaerk
 
(17 intermediate revisions by the same user not shown)
Line 1: Line 1:
 +
__TOC__
 +
 +
= Overview =
 +
 +
Unison is a utility that allows you to compare two directories and to synchronize them as you want.
 +
 +
[[Image:snapshot-unison.png]]
 +
 +
Unison compares two directories by their files' content and allows you for every file to
 +
* propagate from left to right
 +
* propagate from right to left
 +
* show differences
 +
 +
You can use it for backup purposes. Just keep a folder "archive" on your harddisk and copy it to a USB disk. When it has changed some months later, re-sync and you have an up-to-date backup.
 +
 +
= Get it =
 +
* Download it from http://www.cis.upenn.edu/~bcpierce/unison/
 +
* [[unpack]] and [[build]] it (example):
 +
# [[tar]] xvzf unison-2.32.52.tar.gz
 +
# [[cd]] unison-2.32.52/
 +
# [[make]] -j4 && make install
 +
 +
= Run it =
 +
To run Unison to compare two directories on the same computer, start it like this:
 +
unison -times /directory1 /directory2
 +
Here, -times also synchronizes the timestamps.
 +
 +
== over the network ==
 +
To synchronize between two computers over the [[network]], use the ssh:// prefix. In this example, our computers are named ''mars'' and ''earth'':
 +
''mars'':/ # unison -times /srv/www/htdocs/[[mediawiki]] ssh://''earth''//srv/www/htdocs/[[mediawiki]]
 +
 
= TroubleShooting =
 
= TroubleShooting =
  
 +
== Inconsistent state ==
 +
;Symptom:
 
  Warning: inconsistent state.   
 
  Warning: inconsistent state.   
 
  The archive file is missing on some hosts.
 
  The archive file is missing on some hosts.
Line 8: Line 41:
 
  Please delete archive files as appropriate and try again.
 
  Please delete archive files as appropriate and try again.
 
;Solution: Go to ~/.unison and delete the archive file
 
;Solution: Go to ~/.unison and delete the archive file
 +
 +
[[Category:Tool]]

Latest revision as of 14:56, 14 November 2013

Overview

Unison is a utility that allows you to compare two directories and to synchronize them as you want.

Snapshot-unison.png

Unison compares two directories by their files' content and allows you for every file to

  • propagate from left to right
  • propagate from right to left
  • show differences

You can use it for backup purposes. Just keep a folder "archive" on your harddisk and copy it to a USB disk. When it has changed some months later, re-sync and you have an up-to-date backup.

Get it

# tar xvzf unison-2.32.52.tar.gz
# cd unison-2.32.52/
# make -j4 && make install

Run it

To run Unison to compare two directories on the same computer, start it like this:

unison -times /directory1 /directory2

Here, -times also synchronizes the timestamps.

over the network

To synchronize between two computers over the network, use the ssh:// prefix. In this example, our computers are named mars and earth:

mars:/ # unison -times /srv/www/htdocs/mediawiki ssh://earth//srv/www/htdocs/mediawiki

TroubleShooting

Inconsistent state

Symptom
Warning: inconsistent state.  
The archive file is missing on some hosts.
For safety, the remaining copies should be deleted.
  Archive ar12953235d4d7106b0880b820546c3ea1 on host tweedleburg is MISSING
  Archive ar6a548e7688b901a571b72c38e13194ff on host scorpio should be DELETED
Please delete archive files as appropriate and try again.
Solution
Go to ~/.unison and delete the archive file