Why not sync folders outside home with Ubuntu One?

It took me a while to find out that with Ubuntu One I can sync only folders in my home folder. On all other folders the Ubuntu One option is available in preferences, but the actual actions are greyed out.

The Ubuntu One FAQ is quite clear on that:

No, currently you can only select to synchronize folders inside your home directory.

But I actually wonder why and if this is going to change and if there is a trick around it (an other one than setting my home to /) ?

I personally don't have any important data in my home folder other than the program configs. All documents, pictures, music are on a folder called /data that is actually on a different partition. That makes it much easier when one wants to reinstall Ubuntu.


Solution 1:

It's not going to change, at least in the foreseeable future (and on this I can foresee a couple of years into the future). Allowing users to select arbitrary folders outside of their home for syncing with Ubuntu One, which could potentially sync between multiple different computers, opens a large number of usability problems to cover a use case that, quite frankly, isn't all that common.

One of the problems that I remember off the top of my head is that if you try to sync a mount point of a removable device (and quite a few people try to do this), when you remove the device syncdaemon will delete everything; to make it work properly syncdaemon would have to know about devices, detect their removal, things like that. Quite a large effort, and a lot of potential for usability nightmares.

Another problem is if you try to sync a folder with special permissions, ownership or file types in it: think of /etc/, /tmp/ or /dev/ as some of the worst cases. Or any folder you don't own, really. We could simply disallow syncing folders you don't own, but we know for a fact some people are running syncdaemon as root (despite our warnings).

A workaround for you would be to mount (via /etc/fstab, so you're reasonably sure the partition is mounted every time -- otherwise you risk losing your synced data) the /data folder into your home. You could simply move /data to ~/data or, if you have things that have the /data path hardcoded (quite likely), or if you're already used to /data yourself (also quite likely), symlink or bind mount /data to the mount point in your home. If you don't want to see it in your home at all, just make it ~/.data.

Solution 2:

I did manage to get this to work by using a bind mount. The line in /etc/fstab looks like this:

/mnt/s1/Audio   /home/daniel/Music      bind    defaults,bind   0       0

Obviously you will need write permissions to the folder in question. Possibly you may need to own the files also, I'm not sure.

Solution 3:

I suspect the reason is rights. You'll notice that you can't easily edit any of the files outside your home directory either? This is a general security feature of linux, and I suspect that the Ubuntu One developers (quite rightly) feel that the average user would keep all his files in the home directory, where the daemon can easily run without elevated privileges.

On a side note about your configuration, its all a matter of preference, but I keep my complete /home/ on a seperate disk/partition. This does mean that between re-installations you need to go through and delete all the hidden folders/files for a clean install, but will give you the advantage of a completely native home directory with ubuntuone rights, etc. - just a thought.

Solution 4:

In two words: Use Dropbox.

The reasons listed by @Chipaca might be difficult to overcome, but dropbox has managed somehow. True, this solution isn't open source, but until the folks at Ubuntu One solve some major usability problems (this being one of them), lot's of users won't be able to use Ubuntu One.