===== Sync a folder of the Eee PC with a folder of a Linux box, via wifi or Ethernet cable, using Unison ===== ===== Warning ===== * English is not my native language :-X\\ * I relay here the warning about adding new repositories to install new softwares on the Eee pc. It may corrupt your system if not used with precaution ! 8-o\\ * The "linux box" is in my case a pc with Ubuntu Gutsy Gibbon, but I am rather confident that it should work with other distros ===== Pre-requesites ===== * You should be able to ping the Eee pc by its host name, see [[howto:changecomputername]] to change the host name.\\ To avoid troubles, it is advisable to give static IP addresses to both computers.\\ On your Linux box, just add the host name of the Eee PC and its IP address in the /etc/hosts file, with the following command :\\ gksudo gedit /etc/hosts * You should have a basic knowledge of the usage of Unison, there is a lot of documentation about it, for example at :http://www.cis.upenn.edu/~bcpierce/unison/ ===== about Unison ===== Unison is a program to synchronize two folders (and subfolders of course), one of them can be remote. In that case, it uses the SSH protocol to reach the remote computer in a secure way. Unison is intended to be used in a terminal, but it has also a graphical interface, unison-gtk.\\ __So this howto explains how to use Unison with its nice graphical interface (unison-gtk) on the linux box to sync a local folder with a remote folder on the Eee PC__\\ ===== What needs to be installed on the linux box ? ===== ===== (Go the easy way with whatever package manager your distro comes with) ===== * Unison & Unison-gtk\\ * the ssh client: openssh-client, which is most probably installed by default on your linux distro\\ ===== what needs to be installed on the Eee PC ? ===== * Unison & openssh-server First, you have to add the extra repositories, see [[addingxandrosrepos]] Yes, I know, this is quite a long procedure to follow :-/, but I had no difficulties to do it (I am not a linux expert), I had a little message error about a missing public key related to the first repository (Xandros) when I did the final "sudo apt-get update", but there were no consequence for the rest of the procedure.\\ Then, Install Unison with: sudo apt-get install unison Please check that the unison version is the same on both computers, with the command: (sudo) unison -version In my case, version 2.13.16 has been installed on both sides, but note that this is not the current stable. See http://www.seas.upenn.edu/~bcpierce/unison//download/releases/stable/unison-manual.html#news Now install the ssh server, see [[howto:ssh]] At this stage, the linux box should be able to reach the Eee PC with a command like :\\ sudo ssh user@my_eee_hostname But passwords are asked : (first a password for 'sudo', your user password on your linux box), then the password of the user "user" (the only user that is installed on the Eee PC)\\ For the first password, it is not a problem, Unison will do a ssh itself without invoking a "sudo" ...\\ But for the second one, it is more annoying, so I found a procedure on this page : http://linuxproblem.org/art_9.html to be able to use ssh without having to enter a password\\ ===== Running Unison ===== After having installed unison-gtk on the linux box, you should have an icon like 'U' associated with it. When launched the first time, you will have to go through a short setup. A .prf file containing your profile will be created. This file can be edited manually for fine tuning. I show you below a possible Unison profile on the linux box, found in /home/UserOfLinuxBox/.unison, for example : # Unison preferences file root = /home/UserOfLinuxBox/DocForEee/ # left column, local folder to sync root = ssh://user@Asus-eee//home/user/My Documents # right column, remote folder, no need for quotes around 'My Documents' perms = 0 # do not propagate changes of permissions So, Unison on the Eee PC does not have to be run manually, it is invoked by Unison-gtk on the Linux box. **So that's it, it works great for me, I hope it will be the same for you ! :-D** **note** : I also assumed that the local folder on the linux box is a linux file system, if it is a FAT or NTFS file system mounted on the linux distro, you could have permissions issues because of the differnce in files attributes. =====SOURCES===== [[howto:changecomputername]]\\ [[http://www.cis.upenn.edu/~bcpierce/unison/|Documentation about Unison]]\\ [[addingxandrosrepos]]\\ [[howto:ssh]]\\ [[http://linuxproblem.org/art_9.html|SSH login without password]], by Mathias Kettner\\ PLease comment on topic http://forum.eeeuser.com/viewtopic.php?pid=131861#p131861