DEV Community


Posted on

Resumable file upload (TUS protocol implementation) using pure bash

Introducing - bash script for resumable file upload using tus protocol.

GitHub logo adhocore /

TUS client protocol implementation for bash.


Latest Version Travis Build Software License

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
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 (
    tusc <--options>
    tusc <host> <file> [algo]
    -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.
    tusc version                 # prints current version of itself
    tusc --help                  # shows this help
    tusc 0:1080 ww.mp4           # uploads ww.mp4 to
    tusc -f


sudo apt install jq -y

curl -sSLo ~/tusc
chmod +x ~/tusc && sudo ln -s ~/tusc /usr/local/bin/tusc

Getting Started

To get hands on locally, you can install tusd server.


# run tusd server (
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 Ctrl+C

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.

Thanks :)

Top comments (0)