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"
To update this, you can not use --webdav-vendor=nextcloud anymore (rclone 1.68.2), but have to use --webdav-vendor=other.
With nextcloud as vendor rclone checks if the url contains the /dav/files/USER path, which is not used by nextcloud for public shares (Reference to nextcloud docs posted above still valid).
The error message with nextcloud configured as vendor makes me believe that no chunked uploads will be available if the workaround with vendor other is used, but I did not look further:
CRITICAL: 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