Unison

From Openmoko

Revision as of 14:34, 25 November 2008 by Lokomoko (Talk | contribs)

Jump to: navigation, search

Unison File Synchronizer

Unison is a file-synchronization tool for Unix and Windows. It determines all differences between two directory trees and lets the user decide, how to proceed with every differing file.

Unison comes in two flavors:

  • Text mode only version (debian package name: unison)
  • GTK-based graphical version (debian package name: unison-gtk)

Unison can sync

  • between two directory trees on the same computer or
  • between directory trees on two separate machines.

For syncing desktop machine and Neo we use the latter. The recommended way to do this is the remote shell method:

We start unison or unison-gtk on the desktop PC. The program will connect to the Neo via ssh and start a text-only instance of unison on the Neo to retrieve new files or deltas and to modify files on the Neo.

For this to work, ssh must not output any text itself, because unison parses the first line of console output to determine the version of unison on the remote computer:

  • So we should setup ssh for public key authentication as described under USB Networking.
  • If you are working with more than one distribution to boot from or even with more than one device, I found it convenient to make them all use the same host key (/etc/dropbear/dropbear_rsa_host_key).

On the Neo we use the text version of unison. Since there's no native opkg file available currently, we take the debian package. Extract the file unison-2.27.57, copy it to /usr/bin on neo and create a symlink by the name of unison!

When calling Unison via ssh, the console must only show the unison version information:

user@desktoppc:~$ ssh moko unison -version
unison version 2.27.57

Unison allows for multiple configuration profiles on the desktop PC (~/.unison/Openmoko.prf). Mine look like this:

# Unison preferences file

label      = Syncing Openmoko

# the directories on the desktop and on the neo
root       = /home/user/Openmoko/data
root       = ssh://root@moko//media/mmc4

# common options
include Common.opt


# Do not compare modification time
times      = false

########### Music ##############
path       =      music

########### GPS Data ###########
path       =      gps
ignore     = Path gps/Maps/*
ignorenot  = Path gps/Maps/OSM

On first execution of unison on the desktop, unison will create hashes for the entire directory tree. This may take a while.

Unison supports various preferences to interactively include programs for comparing and merging files during synchronization (see the manual).

Personal tools

Unison File Synchronizer

Unison is a file-synchronization tool for Unix and Windows. It determines all differences between two directory trees and lets the user decide, how to proceed with every differing file.

Unison comes in two flavors:

  • Text mode only version (debian package name: unison)
  • GTK-based graphical version (debian package name: unison-gtk)

Unison can sync

  • between two directory trees on the same computer or
  • between directory trees on two separate machines.

For syncing desktop machine and Neo we use the latter. The recommended way to do this is the remote shell method:

We start unison or unison-gtk on the desktop PC. The program will connect to the Neo via ssh and start a text-only instance of unison on the Neo to retrieve new files or deltas and to modify files on the Neo.

For this to work, ssh must not output any text itself, because unison parses the first line of console output to determine the version of unison on the remote computer:

  • So we should setup ssh for public key authentication as described under USB Networking.
  • If you are working with more than one distribution to boot from or even with more than one device, I found it convenient to make them all use the same host key (/etc/dropbear/dropbear_rsa_host_key).

On the Neo we use the text version of unison. Since there's no native opkg file available currently, we take the debian package. Extract the file unison-2.27.57, copy it to /usr/bin on neo and create a symlink by the name of unison!

When calling Unison via ssh, the console must only show the unison version information:

user@desktoppc:~$ ssh moko unison -version
unison version 2.27.57

Unison allows for multiple configuration profiles on the desktop PC (~/.unison/Openmoko.prf). Mine look like this:

# Unison preferences file

label      = Syncing Openmoko

# the directories on the desktop and on the neo
root       = /home/user/Openmoko/data
root       = ssh://root@moko//media/mmc4

# common options
include Common.opt


# Do not compare modification time
times      = false

########### Music ##############
path       =      music

########### GPS Data ###########
path       =      gps
ignore     = Path gps/Maps/*
ignorenot  = Path gps/Maps/OSM

On first execution of unison on the desktop, unison will create hashes for the entire directory tree. This may take a while.

Unison supports various preferences to interactively include programs for comparing and merging files during synchronization (see the manual).