Ever since becoming graduate student, I am in constant despair of syncing my work and study. Luckily, my sister now employed in one of the public accounting and she was promised to have her own (working) laptop. Because of that, I can use my laptop freely and working mobile. It helps a lot and I can work while study and study while working. Thanks to RMS, now I’m in my spirit again to hack into a new system, which I won’t tell yet. [Takut sesumbar :-P]
To have work continuity, I need to sync my home in my laptop and desktop computer. I have three candidates:
- A script from Pak Ibam,
sedotbuilt especially for syncing home.
sedot-ngscript from Kambing.
The #1 script is powerful, but it was designed to syncing into a USB disk and it need some tweak because I have gigs of data in my home. Obviously, #2 is overkill. I don’t need my syncing in plurk and automate. Solution #3 needed to be learned because we are used to use
than that. To make it short, I go with solution #3 because it has a Debian package and have a GUI.
Unison have a powerful option to cope with my need, syncing both place. I can work in my desktop or laptop and get both of them sync each other. Okay, before you get bored, like I do. Let’s try to install it.
#0 Connect your desktop and laptop
A pre condition, your laptop and your desktop is connected and having SSH server installed. In my example, because I’m syncing from laptop, you just need to install the SSH server into your desktop. Every GNU/Linux system by default is installed with SSH client.
In desktop (and optionally on laptop), install SSH:
$ apt-get install ssh
#1 Install unison
$ sudo apt-get install unison-gtk
$ sudo apt-get install unison
Why I install GUI-based in laptop? Well, I synced the data from my laptop and treated my desktop as a server. Another reason is because my desktop using KDE and my laptop using Gnome. Unison is located in
Aplikasi -> Aksesoris -> Unison
#2 Setup A Profile
Profile is a jargon used by unison to a configuration file. You can have many configuration files, each doing specific job.
When first greeted, enter the base (unison use “root” term) directory of which you would like to sync against. I entered my home directory (e.g. “/home/user”).
Press OK and then choose your remote computer, in my case, the desktop’s home directory. If you are funky like me, using non-standard SSH port, select Socket first and then put your non-standard SSH. [NOTE: This step is unecessary for most people]
And don’t forget to select SSH again. Fill the remote Directory and the remote’s Host IP number, before press OK. Here’s the screenshot:
After OK, you are asked of your remote host password. Then you are ready to go.
Honestly, I’m cheated a bit about unison. Usually, people creates a special directory like “/home/user/SYNCED” and put all the synced contents into that directory. I put my home directory, which contain gigs of files which making the unison a little bit lame at initial. So, I close the unison and starts to edit configuration manually to have only few directories that needed to directory.
$ gedit .unison/default.prf
Here’s my (EDITED) default configuration:
# Unison preferences file root = /home/user root = ssh://firstname.lastname@example.org//home/user# Path to synchronize path = Project path = Library path = Dokumen path = .subversion path = .purple path = Musik path = Gambar path = Backup path = Video path = .netbeansignore = Name .directory
As you can see, I only put some of the directory in home. I’m using Bahasa Indonesia as my default installation. KDE4 uses “.directory” directory to keep its meta data. So, I need to exclude that directory. And, uhm… psst… I logged all of my conversations. 😀
Just press GO and you’re done.
#4 MAKAN2x ™
MAKAN2x ™ [This is a trashing section :D]
#5 Just In Case…
you are overwhelmed and don’t want to go all of those step, just do #0 and #1 then copy my configuration to your own “
” and edit as you like. That’s faster. 😀