1 / 3
Caption Text
2 / 3
Caption Two
3 / 3
Caption Three margin testing

Monday, January 4, 2010

How to synchronize remote folder with Unison

How to synchronize with SSH | Chunhao's Blog
(Theoretically it should work, but Godaddy won't keep your connection long enough to do such sync. So I give up, HL 20100105 )

If you are using Ubuntu machine, you can install it from the repository just by one command:

sudo apt-get install unison

There is also a gtk front-end for this software: unison-gtk, but I think it's useless at most time.

Now, another problem comes to front–in order to synchronize files with SSH, both installations of Unison on client and server are required. However, at most time, you don't have the permission to install software such as unison on SSH server. Here, we attack this issue by SSHFS. It allows you to mount a remote folder on your local machine via SSH. Then you can easily sync it like local a folder with Unison.

I wrote a small script to handle the synchronization:

#!/bin/sh sshfs -o workaround=rename username@sshserver:/path/html/wiki wiki-remote/ 
echo
"Synchronising with sshserver"
unison
/var/www/dokuwiki/data ./wiki-remote/data \
-fastcheck yes \
-ignore 'Path cache' \
-ignore
'Path locks'

Modify it to fit your actual environment. Note that the argument of sshfs command "-o workaround=rename", this prevents the "renaming problem".

All things done. Excute this script. Or, you could add an cron job to run this script automatically once per day. Have fun in synchronizing files with SSH!

Synkron - Folder synchronisation

Synkron - Folder synchronisation

Synkron is an application for folder synchronisation that allows you to configure your synchronisations in detail. Despite having many features, the user interface of Synkron is very user-friendly and easy to use.

Synkron is able to synchronise multiple folders at once, analyse folders before sync, restore overwritten or deleted files, plan synchronisations and much more.

Synkron is a cross-platform application and runs on Mac OS X, Linux and Windows.

Synkron is distributed under the terms of the GPL v2 licence.

Featured Post

Windows和Ubuntu双系统完全独立的安装方法

http://www.ubuntuhome.com/windows-and-ubuntu-install.html  | Ubuntu Home Posted by Snow on 2012/06/25 安装Windows和Ubuntu双系统时,很多人喜欢先安装windows,然...