the plan is to built a debian-based sever with owncloud for syncing addressbooks, calendars, files etc. and also access large video-files in the LAN via webdav from some kodi-clients (maybe also use MySQL to store the kodi-settings).
from time to time the same machine will be used via GUI (VNC and/or direct screen) for resource-hungry tasks like ripping, video-encoding etc., everything else will be done with mobile devices and lightweight SBCs.

my question is how can i link the home-folder (/home/"os_user"/) and the owncloud data-files (/var/www/owncloud/data/"oc_user"/files/)? - i don't want to normally "upload"/sync the files since it is the same machine and will use twice the space!
and i'm also afraid of messing up the user-rights...!


my answers/research/guesses so far:

  • hardlinks are unusable because i have to create every folder twice, link every file one by one (via command-line) and also have to delete every file twice.
  • softlinks work, but i'm not sure if it is the best solution (i still have problems with the user-rights)... and what should be the master?
  • is mount --bind (executed via /etc/fstab) the better way? ...what should be the master? and what's with the user-rights?!?
  • or is there a completely different solution i never thought about...?

You can simply symlink /home/os_user to /var/www/owncloud/data/oc_user/files/home and be done with it. By default you will have a read-only access to those files (if at all), pepending on how permissions on your system are configured. You will have to tweak the permissions to obtain full access.

What I would recommend intead is to create a special folder with relaxed permissions (e.g. /home/os_user/share and symlink it to Owncloud tree. That would keep important files (like ~/.Xauthority) safe even if your OwnCloud account is compromised.

Also note that if you modify/remove files via the OS, OwnCloud will not be able to track versions and undelete them (which is kind of obvious if you think about it).

  • 1
    thank you for your answer! -- i unfortunately had to stop this project because lack of time but in a few months i will go further and confirm your answer if it works/helped...! – DJCrashdummy Jan 26 '16 at 11:21
  • 1
    Hint: on my machine Owncloud runs as www-data user, so you'll have to give that user RX permissions to /home/os_user and RWX permissions to /home/os_user/share. Putting os_user and www-data in the same group might make sense. – Dmitry Grigoryev Jan 26 '16 at 11:26

I am running a nextcloud cloud in a similar setup (and it's basically owncloud as of 2018). My research led me to believe that there was really no way around the duplicate-file problem! If I wanted nextcloud to pay attention to any edits I made in my home directory, I have to have it synced with the nextcloud repository. So, basically, :(

If you don't care about ever editing files - e.g., movies, large videos, whatever - you could "upload" them to the server (making 2 copies) and then delete the local copy (back to one), and then just have a soft link to the repository for that directory.

It's not ideal, I know, but I wasn't able to find a way around it. Maybe you will have more luck and/or someone will write a solution at some point!

I do quite like having my own person cloud, though, so that's good at least!

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.