Sync files with unison

Post modules, themes or any other code you want to share with the community.

Moderator: Developers

Posts: 46
Joined: Tue May 03, 2011 7:45 am

Sync files with unison

Postby rasobar » Wed Nov 30, 2011 10:29 pm

We have been experimenting with syncing groupoffice folders locally, so that you can use them offline.
Using unison was most promising and is quite straight forward. Attached you find a config file template.

Code: Select all

# Here are the two folders that shall be synced
# Please create a local folder groupofficesynced, from there you may set links (alias) to other folders if you want
root = /home/ras/syncRAS
# Either unison is available on the server and can be reached through ssh (fast and reliable)
root = ssh://
# Or the remote folder is mounted locally through webdav (very slow syncing, lot of traffic, as all remote files are hashed locally)
# root = /media/groupoffice
If you use the more reliable ssh option, then you need to ensure that both client and server have the same unison version. Simply test with

Code: Select all

unison -version
unison groupofficesynced/ras ssh://
1234 is the non-22 port for SSH. Ubuntu or Debian packages do not have the latest stable unison versions, so best is you install it from here (we are using 2.40.61, which is available for all platforms).
Here is the user manual: ... anual.html

Variants and privacy notes
1. Using the Webdav option (webdav mounte locally), you sync exactly the same file structure that you see in the Web-GUI, including any shared folders, for which you have permissions, but it is slow.
2. Using the SSH way, you may have permission problems as all users belong to www-data. You could sync any user folder, as in /home/groupoffice/users . Reason is that you have to add your user to the www-data group and thus you gain access to all. Any idea to map permissions correctly? Maybe with the userpermissions module?
3. Creating a webdav drive for each user on the server itself to sync against works best and is reflecting all access rights correctly, but is a bit more complex to set up and may not scale. You need to create a davfs2 drive for each user on the server Do not forget to add the hostname for which the GO license has been purchased in /etc/hosts, otherways all internal webdav traffic may circulate through the Internet.
unison preference file, please change .txt to .prf ending and edit the host name inside
(3.63 KiB) Downloaded 383 times

Who is online

Users browsing this forum: No registered users and 2 guests