1

I was successful in installing and setting up owncloud but I am having problems setting up btsync. After reading tutorials it was suggested to install and use btsync and owncloud to make a "dropbox" clone. The problem I am having is setting owncloud and btsync to use the same folder (/medai/sync) where my usb drive is mounted.

In btsync I get this error: Don't have permissions to write to the selected folder.

What should I do?

Is it better to just use owncloud w/out btsync?

3

Owncloud provides the "dropbox" clone without using btsync, but if you want to add secure transfer - I understand that may be a valid addition to the mix.

That being said, your permissions for the file system will need to be enabled for the user running the OwnCloud server and also btsync. Typically this will be www-data on a Debian Apache server and btsync for the btsync portion. It may differ if you are using other than default components such as Nginx etc.

Set the permissions and ownership using chmod and chown, and make sure that the user running the btsync is also in the www-data group so that they can both access the files. To add a user to a group in raspbian, you can use something like adduser btsync www-data to accomplish this. As with almost all commands in Linux, you can use either/both of the options for syntax help - man <command> or (usually) <command> -h or <command> --help.

That should do the trick. But if all else fails, temporarily open permissions up to all users for the target files (chmod -R ugo+rw <folder>) and then let the system run for a moment and check what/who it is actually writing files as - then lock it back down to that user/group, using the commands above.

  • The user I am using is the pi user. Owncloud is not having issues with permissions and is able to access the folder: /media/sync. How to add btsync to www-data? What command would I run to give btsync the same permission as owncloud to /media/sync? Also from my understanding of the tutorials I found btsync is faster than owncloud and is used for syncing while owncloud is used as an web interface for accessing the files. So I assume that btsync syncs the files to owncloud (and any other device running the btsync client) – AncientOwl Dec 22 '13 at 4:00
  • To add btsync to www-data: sudo usermod -a -G www-data btsync. To check: groups btsync. – goldilocks Dec 22 '13 at 11:44
  • 1
    Goldilocks is correct - and you will need to do that. What might be confusing you is that if you are using the default installation of Apache and Owncloud, then the Apache web server is actually running as www-data and your btsync is probably running as btsync , even though YOU are logged in as pi. The webserver is run via the services tools (aka, the system itself) and is set to run as www-data (by default). So, allow group read/write on the fileset (probably /var/www/owncloud) and ensure btsync is in the www-data group so that it can access the files as well. – growlf Dec 22 '13 at 19:20
  • @growlf I have never encountered a scenario where chmod -R 777 wasn't a really bad idea. While there might be one that I have missed, it seems quite dangerous to suggest something like this to a rookie. – n.st Dec 23 '13 at 8:47
  • Just noticed that you are actually setting the permissions to 666, but I still think there should be a more elegant and less error-prone way to do this (e.g. using top/htop to check which user the services are running as). – n.st Dec 23 '13 at 8:51
0

I would take a look at .../.sync/sync.log

It's likely you're running into an open files limit, which effectively halts btsync. In may case I had to increase the number of allowed open files to 20000 and 50000 (soft / hard) in /etc/security/limits.conf.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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