AARNET CloudStor using curl from Command Line

AARNET CloudStor using curl from Command Line

You can use the command line to interface with CloudStor:

curl -O --user "username@university.edu.au" https://cloudstor.aarnet.edu.au/plus/remote.php/webdav/filename.txt

You can supply a password like so:

curl --user "username@university.edu.au:password" https://cloudstor.aarnet.edu.au/plus/remote.php/webdav/filename.txt

curl -T /path/to/file/to/upload --user "username@university.edu.au" https://cloudstor.aarnet.edu.au/plus/remote.php/webdav/

curl -X DELETE --user "username@university.edu.au" https://cloudstor.aarnet.edu.au/plus/remote.php/webdav/file_or_directory

List Contents of Directory:
curl -X PROPFIND --user "username@university.edu.au" https://cloudstor.aarnet.edu.au/plus/remote.php/webdav/ | grep -Po '(?<=/plus/remote.php/webdav/).+?(?=<)'

The grep command cleans up the XML into something nice.
-P for Perl Regex
-o for only print out what was matched.

Make Directory:
curl -X MKCOL --user "username@university.edu.au" https://cloudstor.aarnet.edu.au/plus/remote.php/webdav/dirname

Cool Stuff:

Download all files in Directory (Not Recursive):
curl -X PROPFIND --user "username@university.edu.au" https://cloudstor.aarnet.edu.au/plus/remote.php/webdav/ | grep -Po '(?<=/plus/remote.php/webdav/).+?(?=<)' | while read line; do curl -O --user "username@university.edu.au" "https://cloudstor.aarnet.edu.au/plus/remote.php/webdav/$line"; done

One thought on “AARNET CloudStor using curl from Command Line

  1. This is very useful, thankyou for your help. Do you also know how to upload a directory and its contents to Cloudstor?

Leave a Reply

Your email address will not be published. Required fields are marked *