I may be dumb but I searched a lot for this functionality. Somehow, a lot of strange answer came from search engines (even tried chatGPT that bullshited me as usual)...
You must actually understand a bit of webdav usage in nextcloud to come up with a working solution. So I think it is worth sharing
I got a public directory link share like this one: https://dummycloud.net/s/azer9si8TG02
And I want my local directory "localdir" to be in sync with it.
All I have to do is: rclone sync --webdav-url=https://dummycloud.net/public.php/webdav/ --webdav-user=azer9si8TG02 --webdav-vendor=nextcloud :webdav: .
You can add the parameter -webdav-pass="$(rclone obscure '12345')" if your share is protected by the password 12345.
You don’t have to do rclone conf for this example to work.
I'm always getting "Failed to create file system for ":webdav:": the remote url looks incorrect. Note that nextcloud chunked uploads require you to use the /dav/files/USER endpoint instead of /webdav. Please check 'rclone config show remotename' to verify that the url field ends in /dav/files/USERNAME"