Use API and Curl to download folders

Hello
I’m using curl to download and upload files in my nextcloud instance (I leave the command here that it may be ineteresting for you all):

curl -T file.txt -u user:password https://MYSERVER/nextcloud/remote.php/dav/files/PATH

Where file.txt can be data.tar.gz or any file

My question is: Is it posible to copy (download/upload) a folder with multiple files and folders with one simple command like this? Does WebDav support recursive copy using the API?

I’m creating a tar file and downloading or uploading it, but it’s a little bit annoying

Thanks for your time

Bump :frowning:

Instead of using curl I recommend to use cadaver. With this command line tool you should be able to automate your WebDAV activities better.
To get it working you first need to create a ~/.netrc file and add at least the following lien:

machine MYSERVER login YOUR-LOGIN password YOUR-PASSWORD

Second, you create a command script, e.g. cadaver.rc to tell the program what it should do, like:

open https://MYSERVER/nextcloud/remote.php/webdav/REMOTE-PATH
lcd /YOUR-LOCAL-PATH
mget *txt
quit

Finally you call the command as follows: cadaver -r cadaver.rc

THAT’S IT!