Keeping a Desktop & Laptop in Sync

This post is tagged as backlogged, so the stuff I’m writing here isn’t exactly “new”. Anyway a few years ago (2) I became an owner of a 12″ laptop which was useful to take to class but needed to be constantly synced with my desktop.

Fortunately Gentoo had Unison in its repository. This program works very well and presents a graphics merge window when conflicts arise. After searching for a Sync solution for a while, this is the best that I could find. Emerging unison on Gentoo gets you an executable with a version number to it. A quick

ln -s /usr/bin/unison-2.27 /usr/bin/unison

fixes that inconvenience.

Below is an example unison config in case anyone finds it useful. I saved the file as default.prf in the unison directory.

# Unison preferences file
root = /home/cogent
root = ssh://Turm
# Paths that I want to sync

path = my_stuff
path = school
path = workspace
#path = work
path = .ssh
path = .purple
path = .gnupg
#path = .thunderbird
path = archive/music

ignore = Name *~
ignore = Name .purple/status.xml
ignore = Path .purple/accels
ignore = Name .purple/blist.xml
ignore = Name .purple/prefs.xml
ignore = Name .purple/accounts.xml

log = false
height = 40

Having done that, running

unison default

resulted in a purely automatic sync. To get the process as smooth as possible, you should add your ssh keys to the respective machines. That way you won’t be asked for the password each time. Also, be sure to connect to the machine at least once before connecting with unison. If I remember correctly, it doesn’t present the “add this machine to know ssh hosts” dialog correctly. Possibly resulting in a silent failure.

Comments are closed.