Email This List Email This List Print This List Print This List

How to upload web­site backups to Drop­box

See more info here

Drop­box Upload­er is a BASH script which can be used to upload, down­load, delete, list files (and more!) from Drop­box, an online file shar­ing, syn­chron­iz­a­tion and backup ser­vice.

It’s writ­ten in BASH script­ing lan­guage and only needs cURL.

You can take a look to the GiHub pro­ject page.

Why use this script?

  • Port­able: It’s writ­ten in BASH script­ing and only needs cURL (curl is a tool to trans­fer data from or to a serv­er, avail­able for all oper­at­ing sys­tems and installed by default in many linux dis­tri­bu­tions).
  • Secure: It’s not required to provide your username/​password to this script, because it uses the offi­cial Drop­box API v2 for the authen­tic­a­tion pro­cess.

Please refer to the Wiki for tips and addi­tion­al inform­a­tion about this pro­ject. The Wiki is also the place where you can share your scripts and examples related to Drop­box Upload­er.

Fea­tures

  • Cross plat­form
  • Sup­port for the offi­cial Drop­box API v2
  • No pass­word required or stored
  • Simple step-by-step con­fig­ur­a­tion wiz­ard
  • Simple and chunked file upload
  • File and recurs­ive dir­ect­ory down­load
  • File and recurs­ive dir­ect­ory upload
  • Shell wild­card expan­sion (only for upload)
  • Delete/​Move/​Rename/​Copy/​List/​Share files
  • Cre­ate share link

Get­ting star­ted

First, clone the repos­it­ory using git (recom­men­ded):

git clone https://github.com/andreafabrizi/Dropbox-Uploader.git

or down­load the script manu­ally using this com­mand:

curl "https://raw.githubusercontent.com/andreafabrizi/Dropbox-Uploader/master/dropbox_uploader.sh" -o dropbox_uploader.sh

Then give the exe­cu­tion per­mis­sion to the script and run it:

 $chmod +x dropbox_uploader.sh
 $./dropbox_uploader.sh

The first time you run dropbox_uploader, you’ll be guided through a wiz­ard in order to con­fig­ure access to your Drop­box. This con­fig­ur­a­tion will be stored in ~/.dropbox_uploader.

Usage

The syn­tax is quite simple:

./dropbox_uploader.sh [PARAMETERS] COMMAND...

[%%]: Optional param
<%%>: Required param

Avail­able com­mands:

  • upload <LOCAL_​FILE/​DIR …> <REMOTE_​FILE/​DIR>
    Upload a loc­al file or dir­ect­ory to a remote Drop­box folder.
    If the file is big­ger than 150Mb the file is uploaded using small chunks (default 4Mb); in this case a . (dot) is prin­ted for every chunk suc­cess­fully uploaded and a * (star) if an error occurs (the upload is retried for a max­im­um of three times). Only if the file is smal­ler than 150Mb, the stand­ard upload API is used, and if the ‑p option is used the default curl pro­gress bar is dis­played dur­ing the upload pro­cess.
    The loc­al file/​dir para­met­er sup­ports wild­cards expan­sion.
  • down­load <REMOTE_​FILE/​DIR> [LOCAL_​FILE/​DIR]
    Down­load file or dir­ect­ory from Drop­box to a loc­al folder
  • delete <REMOTE_​FILE/​DIR>
    Remove a remote file or dir­ect­ory from Drop­box
  • move <REMOTE_​FILE/​DIR> <REMOTE_​FILE/​DIR>
    Move or rename a remote file or dir­ect­ory
  • copy <REMOTE_​FILE/​DIR> <REMOTE_​FILE/​DIR>
    Copy a remote file or dir­ect­ory
  • mkdir <REMOTE_​DIR>
    Cre­ate a remote dir­ect­ory on Drop­Box
  • list [REMOTE_​DIR]
    List the con­tents of the remote Drop­box folder
  • share <REMOTE_​FILE>
    Get a pub­lic share link for the spe­cified file or dir­ect­ory
  • saveurl <URL> <REMOTE_​DIR>
    Down­load a file from an URL to a Drop­box folder dir­ectly (the file is NOT down­loaded loc­ally)
  • search <QUERY> Search for a spe­cif­ic pat­tern on Drop­box and returns the list of match­ing files or dir­ect­or­ies
  • info
    Print some info about your Drop­box account
  • space Print some info about the space usage on your Drop­box account
  • unlink
    Unlink the script from your Drop­box account

Option­al para­met­ers:

  • -f <FILENAME>
    Load the con­fig­ur­a­tion file from a spe­cif­ic file
  • -s
    Skip already exist­ing files when download/​upload. Default: Over­write
  • -d
    Enable DEBUG mode
  • -q
    Quiet mode. Don’t show pro­gress meter or mes­sages
  • -h
    Show file sizes in human read­able format
  • -p
    Show cURL pro­gress meter
  • -k
    Does­n’t check for SSL cer­ti­fic­ates (insec­ure)

Examples:

    ./dropbox_uploader.sh upload /etc/passwd /myfiles/passwd.old
    ./dropbox_uploader.sh upload *.zip /
    ./dropbox_uploader.sh download /backup.zip
    ./dropbox_uploader.sh delete /backup.zip
    ./dropbox_uploader.sh mkdir /myDir/
    ./dropbox_uploader.sh upload "My File.txt" "My File 2.txt"
    ./dropbox_uploader.sh share "My File.txt"
    ./dropbox_uploader.sh list

Related Post

admin has written 133 articles