Wednesday, November 21, 2007

Synchronising Plesk with unison

I wanted to synchronise my local files and server with one hosted on a Plesk server.

REMOTE
First, we need to make sure that the server has unison installed.
unison -version
If unison isn't installed, install it
If the version doesn't match the version on the local machine, download the binary from the unison site, move it to /usr/bin and create "ln -s" it to "unison"
Try unison -version again.
Make sure that you can run unison remotely - the first time it is run, it tried to create a .unison directory, so if the environment doesn't allow unison to write to the users home directory, it needs to be created first.

LOCAL
Now locally, create the directory we are going to sync with.
Create the unison config file.
It lives in .unison in your home directory and will look something like:
root = /var/www/vhosts/**site_name**/httpdocs/
root = ssh://**username**@**remote_host**/httpdocs/
Using either unison or unison-gtk, run the first sync

No comments: