Skip to content
Bash script for upload file to cloud storage based on OpenStack Swift API.
Branch: master
Clone or download
yuhenobi Merge pull request #18 from sams-gleb/master
fix upload archive content-type
Latest commit 7069068 Aug 4, 2015
Type Name Latest commit message Commit time
Failed to load latest commit information.
LICENSE Public. May 14, 2012
README Bump 3.0 Oct 23, 2014
README.rst Public. May 14, 2012 fix upload archive content-type Aug 4, 2015 Improve handle errors. Oct 23, 2014


What is supload?

It's simple script for upload file to cloud storage based on OpenStack Swift API.


  • recursive upload
  • check files by MD5 hash
  • upload only modified files
  • expiring files
  • exclude files matches pattern
  • find and upload only newest files
  • limit upload speed
  • auto unpacks archive on uploading (if storage supports)


  • support only less than 5G file to upload


For use script need installed utilities curl and file. Install for debian/ubuntu:

$ apt-get install curl file

Get script:

$ wget && chmod +x
# or
$ curl -Ok && chmod +x

You may move script to /usr/bin or /usr/local/bin if want:

$ mv /usr/local/bin/supload


By default the script work with Selectel Cloud Storage.

Get help:

$ ./

Upload one file, file will be uploaded if not existence in storage or local file is different from file in storage (md5 check):

$ ./ -u USERNAME -k USERKEY storage_dir local_file.path

Upload all files in directory recursive (option -r):

$ ./ -u USRNAME -k USERKEY -r storage_dir local_dir/

Force upload without checking existing files in storage by md5 (option -M):

$ ./ -u USERNAME -k USERKEY -r -M storage_dir local_dir/

If the Storage supports expiring object you can set time when uploaded file must be deleted (option -d). Uploaded file will be deleted after 7 days:

$ ./ -u USERNAME -k USERKEY -d 7d storage_dir file.doc

Exclude some files for upload:

$ ./ -u USRNAME -k USERKEY -r -e ".git/*" -e "file_in_root_dir" -e "dir1/*/*.cache" -e "*~" -e "*.bak" storage_dir local_dir/

Enable detect mime-type (by utility file) and set Content-Type for uploading file (option -c):

$ ./ -u USERNAME -k USERKEY -c storage_dir localfile

Upload only files modified in the last 7 days (option -m):

$ ./ -u USERNAME -k USERKEY -r -m -7 storage_dir local_dir/

Limit upload speed (option -s):

$ ./ -u USERNAME -k USERKEY -r -s 2M storage_dir local_dir/

Upload and extract archive (option -z):

$ ./ -u USERNAME -k USERKEY -z tar.bz2 storage_dir archive.tar.bz2



  • unpack archive
  • improve handle error and debug output
  • add functional tests


  • limit upload speed (-s)


  • added new option for find&filter files by modified time p(-m)
  • fixed parser for etag header
  • added handle for 401 Unauthorized


  • disabled detect mime-type and set content-type by default
  • add option for enable detect mime-type (-c)


  • fixed: reauth when access denied


  • hide password key in cmdline


  • add option for exclude files (-e)


  • add support for expiring files (-d)
  • util file not necessarily now


  • ignore case for auth headers
  • support MacOsX
  • small fixes
You can’t perform that action at this time.