While moving various services and mostly images from an old dropbox account to a fresh Nextcloud docker instance running on a Synology NAS server I needed todo some automated housekeeping so the cloud-cli utility was born. It is basically a bash script doing webdav operations using curl.
Usage: cloud-cli [options]
--host|-H text cloud hostname https://[fqdn|ip][:port]
--user|-U text cloud username
--pass|-P text cloud password
--insecure|-I ignore self signed SSL certs
--list|-l path list date time size name for path elements
--upload|-u file upload file
--download|-d file download file
--pipe|-p file pipe file
--move|-m file move file
--copy|-c file copy file
--to|-t file move/copy destination file
--create|-C dir create directory
--delete|-D file/dir delete file or directory
--local-dir|-d dir local directory (default: /tmp)
--local-file|-f file local file
Config file ~/.cloud-cli
and remember chmod 600 ~/.cloud-cli
Host="https://yoursite.com:443"
User="your-username"
Pass="your-password"
#Insecure="--insecure"
Examples:
$ cloud-cli --list /path
$ cloud-cli --upload local-file.txt
$ cloud-cli --download cloud-file.txt --local-dir /tmp
$ cloud-cli --pipe cloud-file.txt | grep text-string
$ cloud-cli --move cloud-file.txt --to move-to-file.txt
$ cloud-cli --copy cloud-file.txt --to copy-of-file.txt
$ cloud-cli --create cloud-dir
$ cloud-cli --delete [cloud-dir | cloud-file.txt]
URL: https://lightaffaire.com/code
Constructive feedback always appreciated.
Iain