Manage Dropbox in Terminal With Dropbox Uploader

The good thing about Dropbox is that it has a desktop client for almost every OS and mobile device. However, if you need to access Dropbox from your server, or from a small device, like Raspberry Pi, that doesn’t allow you to install the Dropbox client, a better solution is to be able to manage your Dropbox account directly from the terminal (with command line). This is where the Dropbox Uploader script comes in useful.

Dropbox Uploader is a BASH script which can be used to upload, download, list or delete files from Dropbox. The good thing about it is that it doesn’t require you to enter your Dropbox’s username and password. It makes use of the Dropbox API to connect to your Dropbox account so you can transfer your files without worrying about the leak of your password.

Installation

There is only two things that are required for Dropbox Uploader to work: Bash (obviously) and cURL. Bash is included in almost every Linux distro, unless you removed it manually. You will need to install cURL if it is not currently intalled in your system. In Ubuntu-based distro:

To install Dropbox Uploader, first grab the script from its Github site:

Then move it to the “bin” folder:

To get started, simply use the command:

For the first run, it will show you an App name and prompt you to create a Dropbox app with this app name.

dropbox-uploader-app-name

Go to Dropbox Developer site and create an app.

dropbox-uploader-create-app

Here are a few settings that you should set for your app:

  • Type of app: Dropbox API app
  • Type of data: Files and datastores
  • Type of files: All file types

For the app limitation, you can set it to access only files it creates, or all the files in Dropbox.

Back in the terminal, enter the App Key and secret and visit the Dropbox authorization link to grant Dropbox Uploader permission to access your Dropbox account. Once you linked up Dropbox Uploader to your Dropbox account, you will be able to manage your Dropbox in the terminal.

Usage

The usage is pretty simple. There are 10 commands that you can use with Dropbox Uploader:

  • upload
  • download
  • delete
  • move
  • copy
  • mkdir
  • list
  • share
  • info
  • unlink

To upload a file/folder, use the syntax:

If the “filepath/in/dropbox” is omitted, the file(s) will be uploaded to the topmost level of your Dropbox account.

To download a file/folder,

To list down all the files in a folder in your Dropbox account,

To grab the public link for a particular file in Dropbox,

Conclusion

Dropbox Uploader provides a good way for you to access and manage your Dropbox account directly from the terminal. It is particularly useful for web administrators to use in their server. Coupled with a simple backup script and cron job, you can easily automate server backup to Dropbox.

2 comments

  1. hy Mr.. i want to ask you..
    while I write script curl “https://raw.github.com/andreafabrizi/Dropbox-Uploader/master/dropbox_uploader.sh” -o /tmp/dropbox_uploader.sh
    but i’cant finish intsall it.. only show
    //curl performs SSL certificate verification by default, using a “bundle”
    of Certificate Authority (CA) public keys (CA certs). If the default
    bundle file isn’t adequate, you can specify an alternate file
    using the –cacert option.
    If this HTTPS server uses a certificate signed by a CA represented in
    the bundle, the certificate verification probably failed due to a
    problem with the certificate (it might be expired, or the name might
    not match the domain name in the URL).
    If you’d like to turn off curl’s verification of the certificate, use
    the -k (or –insecure) option.//
    i dont know it… i hope you can help me.. thank you

    1. Alternatively, you can go to its github page (
      https://github.com/andreafabrizi/Dropbox-Uploader) and download the Master
      copy. Extract the file and move the “dropbox_uploader.sh” file to
      “/usr/local/bin/” folder.

Comments are closed.