Sync from LAN NAS to cloud server


Recommended Posts

@Fondue 2 possible reasons:
1. The folder you want to add is likely located outside of "/volume*" path (can be fixed by adjusting /usr/local/resiliosync/var/sync.conf, "dir_whitelist" value or by placing your folders inside your /volume1)
2. You don't have enough permissions for the folder you want to add. Very unlikely scenario, as Sync runs under admin on Syno, which is almost root.
 

Link to comment
Share on other sites

@Fondue Oh, okay. By some reason I was confident you got Synology NAS. Anyway, the both item #1 and #2 are still applicatble, but for #1 there are some other paths for WD: "directory_root" in config file only allows to save data in your downloads folder. You can adjust it by changing your config file which stays in "/mnt/HD/HD_a2/Nas_Prog/BitTorrentSync/settings/sync.conf"

Link to comment
Share on other sites

do you mean this file?

 

#!/bin/sh

mkdir -p $HOME/.config/resilio-sync

BTSYNC_STORAGE=$HOME/.config/btsync/storage
RESILIO_STORAGE=$HOME/.config/resilio-sync/storage

CONFIG_PATH=$HOME/.config/resilio-sync/config.json


if [ -d ${BTSYNC_STORAGE} ] && [ ! -d ${RESILIO_STORAGE} ]; then
  # Copy btsync storage folder
  cp -r ${BTSYNC_STORAGE} ${RESILIO_STORAGE}
else
  mkdir -p ${RESILIO_STORAGE}
fi


if [ ! -f ${CONFIG_PATH} ]; then
    sed -e "s|{HOME}|$HOME|g" /etc/resilio-sync/user_config.json > ${CONFIG_PATH}
fi

Link to comment
Share on other sites

... because my usr/local doesnt have the tree you suggested

 

total 32
drwxr-xr-x 2 root root 4096 Okt 21  2015 bin
drwxr-xr-x 2 root root 4096 Okt 21  2015 etc
drwxr-xr-x 2 root root 4096 Okt 21  2015 games
drwxr-xr-x 2 root root 4096 Okt 21  2015 include
drwxr-xr-x 5 root root 4096 Okt 21  2015 lib
lrwxrwxrwx 1 root root    9 Mär 28  2016 man -> share/man
drwxr-xr-x 2 root root 4096 Okt 21  2015 sbin
drwxr-xr-x 8 root root 4096 Okt 21  2015 share
drwxr-xr-x 2 root root 4096 Okt 21  2015 src

 

Link to comment
Share on other sites

Sorry, Roman again meant another file:  /mnt/HD/HD_a2/Nas_Prog/ResilioSync/settings/sync.conf 
see, directory root there is 
/mnt/HD/HD_a2 , so Sync won't be able to write anything above that. You can edit and put "/" there, for example. 

 

5a89acfd0d.png

Else this is just a posix permissions issue, which is unlikely, since Sync runs as admin on NASes, but still worth checking 

Link to comment
Share on other sites

Thank you Helen and Roman for your continued efforts to help me resolve this issue.  I feel like such a N00B not being able to find it.  Not without effort in trying. I cannot find any file system tree even close to the above.  nor any file on my system labeled  sync.conf . to be clear, I installed based on the instructions for a debian based Linux as per this link   https://help.getsync.com/hc/en-us/articles/206178924

first partition ; all the system files and installed programs

second partition - temp files

NAS SERVER  main location of my files shared on my network.  This is the only thing under /mnt  on my Linux computer.  from here, I want to back up some folders with Resilio Sync.

 

Also, I highly doubt it's a posix permissions issue because everything else I do on the system access, reads, writes, adds new directories, deletes, etc. without issue.

 

Link to comment
Share on other sites

under /etc/resilio-sync there are a couple files , this one looks close to what you suggest; 

config.json
{
    "storage_path" : "/var/lib/resilio-sync/",
    "pid_file" : "/var/run/resilio-sync/sync.pid",
    "agree_to_EULA": "yes",

    "webui" :
    {
        "listen" : "127.0.0.1:8888"
    }
}

... edit to read

  "storage_path" : "/",

??

 

the other file is  user_config.json
{
    "storage_path" : "{HOME}/.config/resilio-sync/storage",
    "pid_file" : "{HOME}/.config/resilio-sync/sync.pid",
    "agree_to_EULA": "yes",

    "webui" :
    {
        "listen" : "127.0.0.1:8888"
    }
}

THE THIRD file is init_user_config.sh
#!/bin/sh

mkdir -p $HOME/.config/resilio-sync

BTSYNC_STORAGE=$HOME/.config/btsync/storage
RESILIO_STORAGE=$HOME/.config/resilio-sync/storage

CONFIG_PATH=$HOME/.config/resilio-sync/config.json


if [ -d ${BTSYNC_STORAGE} ] && [ ! -d ${RESILIO_STORAGE} ]; then
  # Copy btsync storage folder
  cp -r ${BTSYNC_STORAGE} ${RESILIO_STORAGE}
else
  mkdir -p ${RESILIO_STORAGE}
fi


if [ ! -f ${CONFIG_PATH} ]; then
    sed -e "s|{HOME}|$HOME|g" /etc/resilio-sync/user_config.json > ${CONFIG_PATH}

 

?

Link to comment
Share on other sites

@Fondue It looks like you've got some custom installation. By default, Sync picks up config from "/mnt/HD/HD_a2/Nas_Prog/ResilioSync/settings/sync.conf" path (thanks @Helen for providing correct path!). There is a very simple way to find out where your Sync instance takes config from. Ensure it is started, SSH to your NAS and run "ps aux | grep rslsync". It'll show you the command line of rslsync, and likely there should be a "--config" parameter, pointing to config file location.

Link to comment
Share on other sites

RomanZ, Thanks again for your continued assistance.

Resilio Install: I followed the instructions for Debian based systems as per the web site link previously advised.  There was no custom install, believe me. :(

I ran the ps aux command line and got this back

rslsync   1068  0.3  0.1 500988 13228 ?        Ssl  10:41   0:04 /usr/bin/rslsync --config /etc/resilio-sync/config.json
kodak      3085  0.0  0.0  15168  2612 pts/5    S+   11:08   0:00 grep --color=auto rslsync

(kodak is my system name)

so ... if you scroll back to the previous post of mine, I have printed out the content of the config.json. 

TYFYC

Link to comment
Share on other sites

@Fondue While re-reading whole topic from scratch (I believe we are close to solution), I've stumbled upon strange thing:

Quote

 

I am running Ubuntu 15.10 and just installed Resilio to sync some folders from my LAN connected NAS over the web.

When I try to add a folder from the NAS, it gives me the error

"Don't have permissions to write to selected folder"

 

So, you've got an Ubuntu computer and you try to add folder that physically stays on NAS? Is it over NFS protocol or via some other protocol? Does your "rslsync" user has enough permission to access this folder over selected protocol? It's worth checking on how this network folder is mounted to your filesystem and which users has access to it.

 

 

Link to comment
Share on other sites

4 minutes ago, RomanZ said:

@Fondue

So, you've got an Ubuntu computer and you try to add folder that physically stays on NAS?

 

YES.  

28 minutes ago, RomanZ said:

@Fondue  Is it over NFS protocol or via some other protocol?

 

I will have to get back to you on how it was mounted but basically it's another harddrive.  sometimes when I boot up, I have to issue a sudo mount -a to get it to mount properly.  otherwise it looks like a local drive.  I also find it in my media subdirectory.   I am trying to reach the guy who installed it to get a more technical reply.  He said the method he did was better than a local network access, more stable. 

 

30 minutes ago, RomanZ said:

@Fondue WIs it over NFS protocol or via some other protocol? Does your "rslsync" user has enough permission to access this folder over selected protocol? It's worth checking on how this network folder is mounted to your filesystem and which users has access to it.

 

 

I have never had issues accessing the NAS HDD with permission issues (as long as it was mounted), so I doubt if permission is the issue.  that being said, I could not even add a folder from the internal hard drive when I tried to test that out.  I think that brings us back to the original editing of a config file - could it be some sort of issue on the config.json file? 

Link to comment
Share on other sites

@Fondue The config.json you dropped has no any limitations:
config.json
 

{
    "storage_path" : "/var/lib/resilio-sync/",
    "pid_file" : "/var/run/resilio-sync/sync.pid",
    "agree_to_EULA": "yes",

    "webui" :
    {
        "listen" : "127.0.0.1:8888"
    }
}

So issue is not in config. But, one of the last outputs you show gives a hint that issue is in permissions:

Quote

rslsync   1068  0.3  0.1 500988 13228 ?        Ssl  10:41   0:04 /usr/bin/rslsync --config /etc/resilio-sync/config.json
kodak      3085  0.0  0.0  15168  2612 pts/5    S+   11:08   0:00 grep --color=auto rslsync

Let me elaborate. This output says that usually you run commands under "kodak" user, which indeed might have no any issues with permissions accessing your network share, whatever file sharing protocol you use. But, Sync is running under "rslsync" user which gets different set of permissions, including access of your mounted drive. If you switch your terminal user to rslsync, most likely you won't be able to access your share.

 

 

 

Link to comment
Share on other sites

2 hours ago, RomanZ said:

But, Sync is running under "rslsync" user which gets different set of permissions, including access of your mounted drive. If you switch your terminal user to rslsync, most likely you won't be able to access your share.
 

ok, I follow you.  I apologize for my ignorance on switching to rslync.  I tried to do a

su rslsync@server 

and it said I didn’t give a password.  I tried searching the interwebs for a standard password to no avail.

not that I would know if it had access to the NAS, anyway.   could you kindly walk me through the process of switching users and then seeing if it has access?

earlier I achieved access with SSH to the NAS, for what its worth.

 

I am a bit frustrated and really want to test out this product. But frankly speaking, when I set up BitTorrent on the mac, it was self explanatory.  I don't understand why this is so complicated on the Linux.... and why this needs to be done manually, or wasn't in the set-up link that was provided...

Link to comment
Share on other sites

You need to set password for user rslsync (sudo passwd rslsync, enter pass) and set default shell for the user (sudo vi /etc/passwd, then replace rslsync's "/sbin/nologin" with "/bin/bash"). After that you can login with the user. Though, the easiest is just to check permissions of the mount point of your network drive. As Sync is running from "rslsync" username, it'll automatically fall into either "group" or even worse - "all users" set of permissions.

Alternatively, you can force Sync to start under your current user account (systemctl --user start resilio-sync, to auto-start when you login also run systemctl --user enable resilio-sync). It'll run under your current user (though will only start up when you login).

Quote

I am a bit frustrated and really want to test out this product. But frankly speaking, when I set up BitTorrent on the mac, it was self explanatory.  I don't understand why this is so complicated on the Linux.... and why this needs to be done manually, or wasn't in the set-up link that was provided...

Sync is multi-platform application. It follows the guidelines and practices for every OS it runs onto. For OS X it is copying image to Applications folder and running under current user account. For Linux that would be installation via packages under it's own user account.

Initial versions of Sync for Linux has no package, just a binary to run. It was very simple for Linux novice users, although it was not a Linux way. We've got a number of accusing feedbacks from Linux adepts.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.