Register for the iXsystems Community to get an ad-free experience and exclusive discounts in our eBay Store.

Setup Unison

Western Digital Drives - The Preferred Drives of FreeNAS and TrueNAS CORE
Status
Not open for further replies.

madrang

Neophyte
Joined
Aug 10, 2012
Messages
4
How to setup Unison in FreeNAS

Download Unison
8.2: i386, amd64 (DEAD)
8.3: i386, Amd64 (DEAD)
9.1: i386, Amd64 (DEAD)
9.3: i386, Amd64
11: i386, Amd64 (2.48.15 is also available)

Extract the file from the archive '/bin/unison' to a folder in one of your pools, all users should have read only access. Ex '/mnt/vol0/bin/unison'

Make sure your users can login using ssh and that they can run '/mnt/vol0/bin/unison -version'

Make a unison .prf file.

Code:
# Roots of the synchronization
label = Home on NAS
root = /home/madrang/
root = ssh://madrang@192.168.1.16/

# Cmd to run unison on FreeNAS
servercmd=/mnt/vol0/bin/unison


Also if some admin is reading this, i would love to add a page for this in the wiki "Setup Unison"

Edit: FreeBSD moved the packages and the old links stopped to work.
This can't easily be fixed as the new server does not allow listing folders.
PortMon was useful to find a freebsd build of Unison-nox11.
 
Last edited:

HeWhoWas

Neophyte
Joined
Jan 26, 2013
Messages
4
Can someone create this page? I've installed my unison binary into /usr/local/bin and it works perfectly. Might be easier than copying it to a volume and referencing it absolutely. I'd like to add the info to the wiki page but I don't have the permissions to create it.
 

ProtoSD

Dedicated Sage
Joined
Jul 1, 2011
Messages
3,353
Send a PM with a draft of what you would like added to Admin here in the forums and patiently wait, it will probably get created.
 

condor85

Newbie
Joined
Jan 23, 2013
Messages
2
I've been watching this thread like a hawk... any info would be huge. freenas (and unix) newbie... but unison is exactly what I need. Looking forward to instructions!
 

anika200

Member
Joined
Mar 18, 2013
Messages
112
Am I missing something, why do I need Unison running or FreeNAS?
I can currently sync all the directories I want with Unison set up on my linux box only. All you have to do is have a nfs share for one of your volumes/slices/pools/directories and have it mounted in Linux somewhere and you can use Unison to keep everything in sync.

As far as I can tell the only reason you would want Unison running on Freenas would be to sync drives/volumes on the NAS itself to make redundancy without RAID. You can do this with the included rsync so there is no need for Unison.

I am not really used to windows shares but I believe SMB and CIFS can both do the exact same thing. Once you share the drive/volume then just use Any sync client to keep things backed up or synced.
 

condor85

Newbie
Joined
Jan 23, 2013
Messages
2
Well, maybe I'm looking at this wrong, but I have two FreeNAS mini boxes at two separate locations around town... and I thought unison would be an easy way to almost bypass VPN. VPN has always been slow and unreliable at times... and I also wanted an offsite backup. I was able to turn on Rsync fine but it would only allow office two the ability to view files, any changes would be undone by office 1.



Am I missing something, why do I need Unison running or FreeNAS?
I can currently sync all the directories I want with Unison set up on my linux box only. All you have to do is have a nfs share for one of your volumes/slices/pools/directories and have it mounted in Linux somewhere and you can use Unison to keep everything in sync.

As far as I can tell the only reason you would want Unison running on Freenas would be to sync drives/volumes on the NAS itself to make redundancy without RAID. You can do this with the included rsync so there is no need for Unison.

I am not really used to windows shares but I believe SMB and CIFS can both do the exact same thing. Once you share the drive/volume then just use Any sync client to keep things backed up or synced.
 

anika200

Member
Joined
Mar 18, 2013
Messages
112
Well, maybe I'm looking at this wrong, but I have two FreeNAS mini boxes at two separate locations around town... and I thought unison would be an easy way to almost bypass VPN. VPN has always been slow and unreliable at times... and I also wanted an offsite backup. I was able to turn on Rsync fine but it would only allow office two the ability to view files, any changes would be undone by office 1.
Unison is probably what you want, you just do not need it running on FreeNAS to have it two way sync of shares. I am not familiar with working with VPN but a quick search indicates you should be able to mount a nfs volume over VPN and therefore use Unison on your local pc to do the sync.
Obviously I am not familiar with your situation and this may not work for you I just wanted to put it out there that you can use Unison without having it running on the FreeNAS box itself.
 

tarabas

Neophyte
Joined
Jun 26, 2013
Messages
6
madrang, thanks for the small tutorial. Tested it today and noticed the following:

If the user that accesses Freenas doesn't have a writeable home-directory, unison ceases to work. This holds true for root as well.
Output of unison (in the ssh terminal):
Fatal error: Error in creating unison directory /root/.unison:
Read-only file system [mkdir(/root/.unison)]
Indeed, it's easy to give any unison user a writable home (e.g. not " /nonexisten").
Unfortunately the home of root cannot be changed - anyway it may be a good idea not to use root for such purposes.

I'd like to mention that the home folder must provide enough space to hold unison's archive and fingerprint files which sometimes can add up to a couple of MiB - just a side note ;).

I'm using unison 2.40.102 under Windows over ssh and for me the path to the unison binary is not given with servercmd= but sshargs, see line 4.
Code:
# Unison preferences
root = ssh://user@10.44.44.106//mnt/space/unison-test
root = D:\_REPO_\vscp_software
sshargs = -C /mnt/space/bin/unison
 
Joined
Sep 22, 2013
Messages
160
Am I missing something, why do I need Unison running or FreeNAS?
I can currently sync all the directories I want with Unison set up on my linux box only. All you have to do is have a nfs share for one of your volumes/slices/pools/directories and have it mounted in Linux somewhere and you can use Unison to keep everything in sync.
Unison running on both ends will access files directly-attached and compare notes, and minimize the network traffic to send only the changes.

Running Unison on a network share will read the entire file (over the network) to then do extra work to determine what changed, and then send that part (again). Missing the point of the analysis.

I suppose it still gives you the two-way update abilities, if you can use some options to make it behave dumber (or does that anyway if it thinks both locations are local?) or you don't mind the overhead.
 

Jit

Newbie
Joined
Oct 26, 2013
Messages
3
Thanks for your post. Really been missing Unison since it disappeared as a plugin. Does anyone know if it's possible to take these instructions and wrap them up as a plugin?
 

Jit

Newbie
Joined
Oct 26, 2013
Messages
3
Agreed, it would be great if it was part of freenas itself. But given its been gone for over a year I'd be happy to see it as a plugin.

I'm almost tempted to move to another nas distribution which has it built in. Just hanging on because I really like freenas and hope someone might be able to resolve this.

Really surprised that it's been missing for so long, since it seems to be the only viable option for two way sync.
 

madrang

Neophyte
Joined
Aug 10, 2012
Messages
4
Updated the original post with link to download Unison for FreeNAS 9.3
 
Status
Not open for further replies.
Top