Rclone serve or rclone mount? Google Drive / Plex Server but wanting to expose the remote on the LAN for direct connection

So, right now, the mount appears when the task is run. However, it is unshared, and I have to enable sharing every time I restart the computer.

Is there any way I can maintain the sharing configuration, or automate sharing permissions assignment using task scheduler?

sure,

from the command line

net share theshare=e:
theshare was shared successfully.

dir \\localhost\theshare
Volume in drive \\localhost\theshare is wasabimediacrypt_user01
Volume Serial Number is 00B5-D8A0

Directory of \\localhost\theshare

04/16/2020 07:44 PM m
0 File(s) 0 bytes
1 Dir(s) 1,125,899,906,842,624 bytes free

for more info
net help share
and
https://ss64.com/nt/net-share.html

Thanks for all your help!

Finally got it to work in an automated fashion.

I created a mount task and a share task. Both are triggered on log in of user. I had to use an inelegant 15 second delay in trigger for the share task to get the timing to work properly. I wonder if there's a better way to do that. AFAI can tell, there's no way to sequentially execute tasks, and because the tasks require different users, the regular action window won't work to sequentially execute.

Anyway, the set up works now, it could probably be improved if you have some ideas, but it wouldn't have been possible without your assistance!

batch files always, by default, run the command sequentially, but that can be changed per command

If I could batch tasks that would be great, but because I need different users, I can't batch the two operations:

Use SYSTEM user to create shareable mount
Use Administrator to share mount

for sure, you can to both in one script run as system user.

I wasn't able to do it as system unfortunately, even with highest privileges. I kept getting Access is denied.

set root=c:\data\rclone\scripts
set cur=%root%\rr\other\mount\
cd /d %root%

set RCLONE_CONFIG_PASS=fdsaasdf
set RCLONE_CONFIG=%root%\rclone.conf

set rcmd=%root%\rclone.exe
set logfile=%cur%\log.system.txt
set nslog=%cur%\ns.txt
set log=--log-file=%logfile% --log-level=INFO
set flags=--allow-other --vfs-cache-mode=writes --dir-cache-time=5m --user-agent="en07"

del %logfile%
del %nslog%

start %rcmd% mount wasabimediacrypt_user01: e: %flags% -vv

timeout /t 10

echo BEFORE NET SHARE>> %cur%\ns.txt
net share >> %cur%\ns.txt
echo RUNNING net share theshare=e: >> %cur%\ns.txt
net share theshare=e: >> %cur%\ns.txt
echo AFTER NET SHARE >> %cur%\ns.txt
net share >> %cur%\ns.txt
dir \\localhost\theshare >>  %cur%\ns.txt

will give you this output

BEFORE NET SHARE

Share name Resource Remark


B$ B:\ Default share
C$ C:\ Default share
R$ R:\ Default share
E$ E:\ Default share
IPC$ Remote IPC
ADMIN$ C:\WINDOWS Remote Admin
data C:\data
The command completed successfully.

RUNNING net share theshare=e:
theshare was shared successfully.

AFTER NET SHARE

Share name Resource Remark


B$ B:\ Default share
C$ C:\ Default share
R$ R:\ Default share
E$ E:\ Default share
IPC$ Remote IPC
ADMIN$ C:\WINDOWS Remote Admin
data C:\data
theshare e:\
The command completed successfully.

Volume in drive \localhost\theshare is wasabimediacrypt_user01
Volume Serial Number is 628B-CE8A

Directory of \localhost\theshare

04/18/2020 11:02 AM m
0 File(s) 0 bytes
1 Dir(s) 1,125,899,906,842,624 bytes free

I use /GRANT to assign permissions in my net share command, that might be why I can't use SYSTEM user to do so.

works for me,
can you post your net share command

net share theshare=e: /grant:en07\user01,FULL /grant:en07\user01,FULL /grant:en07\block,read >> %cur%\ns.txt

image

net share theshare
Share name theshare
Path e:
Remark
Maximum users No limit
Users
Caching Manual caching of documents
Permission EN07\user01, FULL
EN07\block, READ

C:\Windows\System32\net.exe share "Google Drive XYZ"=Z: /users:20 /grant:Everyone,read /grant:Administrators,full

my advice is never to use space character for folders, filenames, rclone remotes.

why did you add /users:20? remove it for testing.

1 Like

Just to mirror the default Windows sharing conditions.

I'm pretty sure SYSTEM user can't set permissions on Administrators group.

Regardless, I'll test and report back on next restart.

no need to restart,

  1. goto task manager and kill rclone.
  2. use task scheduler to start task on demand.
  3. repeat as needed

This doesn't work, because when I run the share task as system user after everything is loaded, and the rclone task is restarted, the share task works. However, when triggered on restart, using the actions screen to load the tasks sequentially, the share doesn't work (under SYSTEM user).

I've come to conclude that non-restart testing isn't conclusive.

/grant:Administrators,full works no problem.

net share theshare=e: /grant:en07\user01,FULL /grant:en07\user01,FULL /grant:en07\block,read /grant:Administrators,full >> %cur%\ns.txt

Share name theshare
Path e:
Remark
Maximum users No limit
Users
Caching Manual caching of documents
Permission EN07\user01, FULL
EN07\block, READ
BUILTIN\Administrators, FULL

/grant Administrators,full works now for me as well when I kill rclone and run on-demand as SYSTEM.

I fully expect to see this task fail next restart, but that won't be awhile since I'm copying a TB of data from my cloud drive atm.

good, step by step, you will get it working 100%

Thanks for all your help so far.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.