Cloudsend.sh
Bash script that uses curl to send files and folders to a nextcloud/owncloud shared folder. Also available to create dirs and delete files/folders, among other utilities.
Install / Use
/learn @tavinus/Cloudsend.shREADME
Tavinus CloudSender2
Bash script that uses curl to send files and folders to a nextcloud / owncloud publicly shared folder.
If you want to support this project, you can do it here :coffee: :beer:
The logic is
cloudsend <file/folder/glob> <PublicURL>
The Origins are here, Thanks for everyone that contributed on the original GIST
Also check my cloudmanager app for a full nextcloud/owncloud webdav client.
Shares with passwords
Cloudsend v2 changed the way password parsing works.
Cloudsend 0.x.x used the -p parameter for the Environment password (changed to -e in v2+).
Please use EITHER -e OR -p, but not both. The last to be called will be used.
- Env Pass > Set the variable
CLOUDSEND_PASSWORD='MySecretPass'and use the option-e - Param Pass > Send the password as a parameter with
-p <password>
Input Globbing
You can use input globbing (wildcards) by setting the -g option.
This will ignore input file checking and pass the glob to curl to be used.
You MUST NOT rename files when globbing, input file names will be used.
You MUST NOT send folders when globbing, only files are allowed.
Glob examples:
'{file1.txt,file2.txt,file3.txt}''img[1-100].png'
More info on globbing
https://github.com/tavinus/cloudsend.sh/wiki/Input-Globbing
Read from stdin (pipes)
You can send piped content by using - or . as the input file name (curl specs).
You MUST set a destination file name to use stdin as input ( -r <name> ).
From curl's manual:
Use the file name - (a single dash) to use stdin instead of a given file.
Alternately, the file name . (a single period) may be specified instead of - to use
stdin in non-blocking mode to allow reading server output while stdin is being uploaded.
Sending entire folder
From v2.2.0 cloudsend.sh can send folders. It will traverse the folder tree, create
each folder and send each file. Just use a folder path as input.
Other ways to send folders:
This sends every FILE in the current shell folder.
- change the first
./to change the input folder ( eg.'/home/myname/myfolder') -maxdepth 1will read current folder only, more levels go deeper, supressing goes all levels
find ./ -maxdepth 1 -type f -exec ./cloudsend.sh {} https://cloud.mydomain.tld/s/TxWdsNX2Ln3X5kxG -p yourPassword \;
This sends every FILE inside /home/myname/myfolder, including ALL subfolders.
find /home/myname/myfolder -type f -exec ./cloudsend.sh {} https://cloud.mydomain.tld/s/TxWdsNX2Ln3X5kxG -p yourPassword \;
This sends a gziped tarball of the current shell folder.
tar cf - "$(pwd)" | gzip -9 -c | ./cloudsend.sh - 'https://cloud.mydomain.tld/s/TxWdsNX2Ln3X5kxG' -r myfolder.tar.gz
This sends a gziped tarball of /home/myname/myfolder.
tar cf - /home/myname/myfolder | gzip -9 -c | ./cloudsend.sh - 'https://cloud.mydomain.tld/s/TxWdsNX2Ln3X5kxG' -r myfolder.tar.gz
This sends a recursive zip file of /home/myname/myfolder.
zip -q -r -9 - /home/myname/myfolder | ./cloudsend.sh - 'https://cloud.mydomain.tld/s/TxWdsNX2Ln3X5kxG' -r myfolder.zip
Create Folder
Since version 2.3.2 you can create folders in the remote server with the -C|--mkdir parameter. It can be a single folder or a tree.
Just pass the folder to be created as if it was the file being sent.
$ ./cloudsend.sh -C -p MyPassword 'A Folder' "https://cloud.mydomain.tld/index.php/s/H4Q3RHXZ4e974PY"
Tavinus Cloud Sender v2.3.5
> Color mode OFF
> Using password from Parameter
> Makedir mode is ON
‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗
CREATING FOLDERS ON TARGET
‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
A Folder > OK (created)
‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗
MAIN TARGET DOWNLOAD URL
‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
Download URL: >
https://cloud.mydomain.tld/index.php/s/H4Q3RHXZ4e974PY/download?path=/A Folder
https://cloud.mydomain.tld/index.php/s/H4Q3RHXZ4e974PY/download?path=%2fA%20Folder
Access URL: >
https://cloud.mydomain.tld/index.php/s/H4Q3RHXZ4e974PY?path=/A Folder
https://cloud.mydomain.tld/index.php/s/H4Q3RHXZ4e974PY?path=%2fA%20Folder
‗‗‗‗‗‗‗‗‗
SUMMARY
‾‾‾‾‾‾‾‾‾
Curl : NO Errors
CurlExit : 0
WebDav : NO Errors
Status : Makedir Completed
Root : /
Base : /
Full : /
Target : A Folder
Type : Directory
Deleting Files/Folders
Since version 2.3.1 you can delete files and folders at the remote server.
Just use the option -D|--delete and pass the file/folder to be deleted as if it was the file being sent.
This example deteles A Folder from the remote server with all its subfolders and files.
$ ./cloudsend.sh -D -p MyPassword 'A Folder' "https://cloud.mydomain.tld/index.php/s/H4Q3RHXZ4e974PY"
Tavinus Cloud Sender v2.3.5
> Using password from Parameter
> Delete mode is ON
‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗
DELETING TARGET
‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
A Folder > OK (deleted)
‗‗‗‗‗‗‗‗‗
SUMMARY
‾‾‾‾‾‾‾‾‾
Curl : NO Errors
CurlExit : 0
WebDav : NO Errors
Status : Delete Completed
Root : /
Base : /
Full : /
Target : A Folder
Type : Unknown
Target Folder
Since version 2.3.2 you can set a target folder for remote operations with the -T|--target parameter. It can be a single folder or a tree.
The target tree will be created before running the operations, unless you are running the delete command.
All commands will use the target folder as the base folder (delete, send, create folder, etc).
$ ./cloudsend.sh -p MyPassword -T 'A Folder/ A Subfolder' ./README.md "https://cloud.mydomain.tld/index.php/s/H4Q3RHXZ4e974PY"
Tavinus Cloud Sender v2.3.5
> Using password from Parameter
> Base Target folder set to: "/A Folder/ A Subfolder"
‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗
CREATING BASE TARGET FOLDERS
‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
A Folder > OK (created)
A Folder/ A Subfolder > OK (created)
‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗
SENDING SINGLE FILE
‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
README.md >
######################################################################### 100.0%
‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗
MAIN TARGET DOWNLOAD URL
‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
Download URL: >
https://cloud.mydomain.tld/index.php/s/H4Q3RHXZ4e974PY/download?path=A Folder/ A Subfolder&files=README.md
https://cloud.mydomain.tld/index.php/s/H4Q3RHXZ4e974PY/download?path=A%20Folder%2f%20A%20Subfolder&files=README.md
Access URL: >
https://cloud.mydomain.tld/index.php/s/H4Q3RHXZ4e974PY?path=A Folder/ A Subfolder&files=README.md
https://cloud.mydomain.tld/index.php/s/H4Q3RHXZ4e974PY?path=A%20Folder%2f%20A%20Subfolder&files=README.md
‗‗‗‗‗‗‗‗‗
SUMMARY
‾‾‾‾‾‾‾‾‾
Curl : NO Errors
CurlExit : 0
WebDav : NO Errors
Status : Send Completed
Root : /
Base : /A Folder/ A Subfolder
Full : /A Folder/ A Subfolder
Target : README.md
Type : File
Root Folder (URL)
Cloudsend also supports reading the root folder from the URL (if the URL links to a folder).
Cloudsend will NOT try to create this folder, it must already exist, but it will use it as a base root folder for everything, including the base --target setting.
Links with folders have a syntax https://cloud.mydomain.tld/index.php/s/H2Q3RHXZ4f974sY?path=my root.
That ?path=my root defines 'my root' as the root target folder.
In this example 'my root' already existed on the server, otherwise we would get errors
$ ./cloudsend.sh -p MyPass -T 'A Folder/A Subfolder' "../folder 1" "https://cloud.mydomain.tld/index.php/s/H4Q3RHXZ4e974PY?path=my root"
Tavinus Cloud Sender v2.3.6
> Using password from Parameter
> Base Target folder set to: "/A Folder/A Subfolder"
> Root Target folder set from URL: "my root"
‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗
CREATING BASE TARGET FOLDERS
‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
A Folder > OK (created)
A Folder/A Subfolder > OK (created)
‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗
CREATING FOLDER TREE AT DESTINATION
‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
folder 1 > OK (created)
folder 1/folder 1-a > OK (created)
folder 1/folder 1-a/folder 1 a 1 > OK (created)
folder 1/folder 1-b > OK (created)
‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗
SENDING ALL FILES FROM FOLDER TREE
‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
folder 1/file 1.txt >
######################################################################### 100.0%
folder 1/file 2.txt >
######################################################################### 100.0%
folder 1/file 3.txt >
######################################################################### 100.0%
folder 1/folder 1-a/file 2 3.txt >
######################################################################### 100.0%
folder 1/folder 1-a/folder 1 a 1/file 6.txt >
######################################################################### 100.0%
folder 1/folder 1-b/file 5.txt >
######################################################################### 100.0%
‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗
MAIN TARGET DOWNLOAD URL
‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
Download URL: >
https://cloud.mydomain.tld/index.php/s/H4Q3RHXZ4e974PY/download?path=my root/A Folder/A Subfolder/folder 1
https://cloud.mydomain.tld/index.php/s/H4Q3RHXZ4e974PY/download?path=my%20root%2fA%20Folder%2fA%20Subfolder%2ffolder%201
Access URL: >
https://cloud.mydomain.tld/index.php/s/H4Q3RHXZ4e974PY?path=my root/A Folder/A Subfolder/fold
Related Skills
node-connect
352.9kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
111.5kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
352.9kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
352.9kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。

