Rclone one-liner to connect a Webdav Mount without rclone.conf

What is the Question you are having with rclone?

I want to know how to connect a webdav drive without using "rclone.conf" using just one line of code

right now I use this:

rclone.exe mount nameofconfig: Z:  --fuse-flag --VolumePrefix=\server\home --vfs-cache-mode full

and rclone.conf:

[nameofconfig]
type = webdav
url = https://domain.tld/remote.php/dav/files/username/
vendor = nextcloud
user = username
pass = *************************************************

What is your rclone version (output from rclone version)

rclone.exe version
rclone v1.53.2

  • os/arch: windows/amd64
  • go version: go1.15.2

Which OS you are using and how many bits (eg Windows 7, 64 bit)

Windows 10, 64bit

Which cloud storage system are you using? (eg Google Drive)

Nextcloud on Raspberry PI 4 on my local Network.

hello and welcome to the forum,

you would need to add flags to replace each item in the config file.
you could try something simple like
rclone ls :webdav: --webdav-url=https://domain.tld/remote.php/dav/files/username/ --webdav-vendor=nextcloud --webdav-user=username --webdav-pass=password
then try the mount command

I think the following should be equivalent.

rclone.exe mount :webdav: Z:  --fuse-flag --VolumePrefix=\server\home --vfs-cache-mode full --webdav-vendor nextcloud --webdav-url https://domain.tld/remote.php/dav/files/username/ --webdav-user username --webdav-pass pw

Note that the password, pw, must be in obscured form, so you need to generate it using rclone obscure password, see: https://rclone.org/commands/rclone_obscure/

hey there

thank you for the command only thing not working is "--vfs-cache-mode full"
as it tells me this:

 ERROR : Failed to create vfs cache - disabling: failed to make cache directory: make cache directory failed: mkdir \\?\C:\Users\username\AppData\Local\rclone\vfs\:webdav: The filename, directory name, or volume label syntax is incorrect.

do you have an idea why this happens when running th ecommand instea dof usign my config-file? is it because of "mkdir" maybe? because it's not available on windows?

changing the directory manually doesn't help:
--cache-dir C:\Users%username%\AppData\Local\rclone\vfs%username%

this generates a new vfs folder inside C:\Users%username%\AppData\Local\rclone\vfs%username% but still wants to create a new folder which is named ":webdav:" which won't work on windows

I think that is a bug, but have an idea how to fix it. Don't know if there is a workaround that can be used in the meantime..

Edit: Submitted a pull request (#4769) which should fix it, and hopefully it will be included in the next version of rclone.

2 Likes

here is a one-liner, no rclone.conf

set "rclone_config_nameofconfig_type=ftp" & rclone.exe mount nameofconfig: z: --ftp-host=127.0.0.1 --ftp-user=username --ftp-pass=_vqQQBawYNpKkX94wEOpuVTScIlsx0MT --vfs-cache-mode=full -vv
2020/11/13 18:57:41 DEBUG : vfs cache: root is "\\\\?\\C:\\Users\\user01\\AppData\\Local\\rclone\\vfs\\nameofconfig"
2020/11/13 18:57:41 DEBUG : vfs cache: metadata root is "\\\\?\\C:\\Users\\user01\\AppData\\Local\\rclone\\vfs\\nameofconfig"
2020/11/13 18:57:41 DEBUG : Creating backend with remote "\\\\?\\C:\\Users\\user01\\AppData\\Local\\rclone\\vfs\\nameofconfig"
2020/11/13 18:57:41 DEBUG : fs cache: renaming cache item "\\\\?\\C:\\Users\\user01\\AppData\\Local\\rclone\\vfs\\nameofconfig" to be canonical "//?/C:/Users/user01/AppData/Local/rclone/vfs/nameofconfig"
2020/11/13 18:57:41 DEBUG : fs cache: switching user supplied name "\\\\?\\C:\\Users\\user01\\AppData\\Local\\rclone\\vfs\\nameofconfig" for canonical name "//?/C:/Users/user01/AppData/Local/rclone/vfs/nameofconfig"
2020/11/13 18:57:41 DEBUG : ftp://127.0.0.1:21: Mounting on "z:"

so something like this would work for you

set "rclone_config_nameofconfig_type=webdav" & rclone.exe mount nameofconfig: z: --webdav-url=https://domain.tld/remote.php/dav/files/username/ --webdav-vendor=nextcloud --webdav-user=username --webdav-pass=password --vfs-cache-mode=full --fuse-flag --VolumePrefix=\server\home -vv
1 Like

There is an issue for this one:

2 Likes

thx this works 1:1 :slight_smile:
I still really hope albertonys fix will be in the next build

thanks everybody for this fast and competent support.

with a name like rcloneLover,
i just had to give you a solution :upside_down_face:

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