miscellaneous tips

Menu

Zend Studio: syncing files with remote server using unison

Let’s suppose you’re developing some web project. It’s a common situation when you need to sync some files with your server, isn’t it? I’ve first ran into this need two weeks ago, and I found a lack of complete solutions/guides… I’ll only share my experience. Hope this would help someone. So, what do we got?

Shared hosting:

No root access.

Gentoo (this method should work on MANY other systems too, see compatibility table here)

Although “rsync” tool is accessible on my hosting, unison was not installed. And There’s not enough privileges to “emerge unison”. That’s why we need to Bootstrap Gentoo-Prefix first – it allows to install packages to your local package manager.

Although ping to my server is ~15ms, and bandwidth is ~4MB/s, performance is poor: each directory listing required not less than a second, so did each operation with a file. (Although FtpUse was a bit faster). Parsing a project would take ages.

Of these three – NetDrive is working together with mklink. I believe this is a DokanFS bug.

Lyrical Digression: «Why Unison? »

Because, in contrast to rsync, it’s a two-way sync tool. It monitors changes.

If you try to use rsync for a while, you’ll end up with a question like this: Two way sync with rsync and you best-answer would be “try unison”.