tusc.sh - bash script for resumable file upload using tus protocol.
tusc is TUS client protocol implementation for bash.
tusc lets you upload big files to servers supporting tus protocol right from your terminal.
If anything goes wrong, you can rerun the command to resume upload from where it was left off.
# Requirements: # jq sudo apt install jq -y curl -sSLo ~/tusc https://raw.githubusercontent.com/adhocore/tusc.sh/master/tusc.sh chmod +x ~/tusc && sudo ln -s ~/tusc /usr/local/bin/tusc
Usage and Examples
tusc v0.0.1 | (c) Jitendra Adhikari tusc is bash implementation of tus-client (https://tus.io) Usage tusc <--options> tusc <host> <file> [algo] Options: -a --algo The algorigthm for key &/or checksum. (Eg: sha1, sha256) -f --file The file to upload. -h --help Show help information and usage. -H --host The tus-server host where file is uploaded. Examples: tusc version # prints current version of itself tusc --help # shows this help tusc 0:1080 ww.mp4 # uploads ww.mp4 to http://0.0.0.0:1080 tusc -f
sudo apt install jq -y curl -sSLo ~/tusc https://raw.githubusercontent.com/adhocore/tusc.sh/master/tusc.sh chmod +x ~/tusc && sudo ln -s ~/tusc /usr/local/bin/tusc
To get hands on locally, you can install tusd server.
# run tusd server (http://0.0.0.0:1080) tusd -dir ~/.tusd-data & # start uploading large files DEBUG=1 tusc --host 0:1080 --file /full/path/to/large/file
While upload is in progress, you can force abort it using
Then resume upload again:
DEBUG=1 tusc --host 0:1080 --file /full/path/to/large/file
It should start from where it last stopped.
You can check the uploaded files like so:
ls -al ~/.tusd-data
Feedback and suggestions are welcome and highly appreciated.