Simple backup to DropBox

There are a lot of backup solution and options available, but most of them are for business and professional usage. If you need free and simple solution that works on any Linux distribution then consider reading this article. As you know DropBox offers 2 GB of free storage. If you refer your friends to Dropbox, you can earn up to 16 GB of additional space. This is more than enough to backup a WordPres site for example.

To setup simple backup solution that uses DropBox you need of three things: DropBox account, curl and script called Most probably you already have DropBox account, but if you don’t have one, register one for free from here.

Also make sure that you refer some friends to sign in order to get some more free space.

Next you need to install a cURL. cURL is a command line tool for transferring data using various protocols – FTP, FTPS, HTTP, HTTPS and many more. Another similar project is wget. Anyway curl is available on all major Linux distributions.

To install it on Ubuntu / Debian

sudo apt-get install curl

To install it on Fedora

yum install curl

After that you need to download and install DropBox Uploader. As name suggests Dropbox Uploader is a simple bash script which can be used to upload, download, delete, and do much more with Dropbox.

To download and install it execute the following commands:

mkdir dropbox
cd dropbox
curl "" -o
chmod 755

First make a directory where to download it, then navigate to this directory. Third command actually downloads Then give the execution permission to the script. And finally execute script.

When script is executes for the first time it will ask you couple of questions. So be prepared to login to your DropBox account and to perform required tasks.

simple backup on linux

Next step is to login to you DropBox account and to go to the following address – Then click the button Create App.

linux backup to dropbox

On next screen you have to select Dropbox API app. Look into screenshots for more details.

simple backup dropbox

On next screen you have to select Files and datastores. Look into screenshots for more details.

linux backup to dropbox

Then on next question “Can your app be limited to its own folder?” for maximum security select Yes – My app only needs access to files it creates.

simple linux backup solution

And finally give some name for that App. In our case HowOpenSourceBackup and click Create app button.

simple linux backup

Now you app is created on next screen some information is present and you need to enter that information into your dropbox uploader script. So copy and paste following information from you browser to you terminal window.

simple backup solution for linux

Finally it should look something like that. Script asks you to copy and paste some URL from terminal to browser in order to allow access of DropBox Uploader script to this new created app.

linux backup solution

When you copy and paste authorization URL that DropBox Uploader script generates, you will be asked to confirm access to that app. So click “Allow” and you have to be ready. You can find this new created folder in DropBox account into following path Files/Apps/HowOpenSourceBackup in our case. So you can delete or see what is uploaded here from script.

To test that everything is OK you can try to upload some test file. So what about to upload the script itself. In order to test that it works simply run the command:

./ upload .

Now when you go to you DropBox account and application folder you will see that you have one file You can delete it as it was just simple test.

Script has similar format options to cp and mv commands. So if you are familiar with them should not be a problem to start using it.

howopensource@debian:~/dropbox$ ./
Dropbox Uploader v0.14
Andrea Fabrizi -


         download  [LOCAL_FILE/DIR]
         list     [REMOTE_DIR]

Optional parameters:
        -f  Load the configuration file from a specific file
        -s            Skip already existing files when download/upload. Default: Overwrite
        -d            Enable DEBUG mode
        -q            Quiet mode. Don't show messages
        -p            Show cURL progress meter
        -k            Doesn't check for SSL certificates (insecure)

For more info and examples, please see the README file.

As you see most of commands are self explanatory.

If you want to run script automatically as cron job you have to consider some additional steps in mind. For example you execute script as you regular user, but when run under cron job it may needs path to it’s configuration file. So use option -f to specify configuration file. Bu default configuration file is stored in your home directory under name “.dropbox_uploader“.

On script wiki page are some good example of how to run it automatically to backup your data via cron job.

Basically you have to consider two things in mind – path to script and to specify path to configuration file. Other stuff that you have to keep in mind is that you have to generate file backup name using date. Also should consider deleting old backup files to free some space. For example calculate how many backup files you can store on space that you have. And consider deleting files that are more than one month old. This can be done also via this script.

DELDATE=`date --date="-30 day" +%Y%m%d`
./ delete backup-${DELDATE}.tar.gz

Consider adding above snippet at the end of backup script that is run by cron job.

Hope this article gives you basic idea how to setup simple and easy backup on linux computers to widely used DropBox.

  • IJK

    Why do people keep using Dropbox when there are vastly superior alternatives out there? To begin with, 2GB is laughable – GoogleDrive gives you 8 times as much. As for paid services, CrashPlan gives unlimited storage for less than $5/month. Dropbox is just the MS of the cloud backup world.

    • Dan

      Let me tell you why. Dropbox is truly cross-platform with native official clients. Tell me how you access Google Drive on Linux.

  • DG O’Brien

    Thanks for the great tutorial! I’m a lazy guy and found a freebie call CloudBacko that can do the same job for me without scripting. Here’s their site: Besides Dropbox, it can also backup to other free cloud storage such as Google Drive ( and OneDrive ( The best thing is that they allow you to combine as many Google Drive, OneDrive and Dropbox accounts into one big pool of cloud storage, so that you can get as many cloud storage space as you need for free. Another cool feature is there file and folder name encryption. Worth to take a look. Cheers.

  • Пелагон Громойло
  • Lawrence Lam

    A zillion THANKS for this tutorial. It is very good! I managed to set up an cronjob to upload all my backup files (generated by cPanel) at /backu/cpbackup/weekly/*.tar.gz to Dropbox. It works perfectly.

    I have a 23Gb FREE Dropbox account. The backup used up 8Gb on my Dropbox.

    I still think Dropbox is far more superior than Google Drive, Apple Cloud… or whatever.

  • SorteDiaboli

    OMG! So you are backupping your data to a subdivision of CIA?
    Nasty Sleepers! Trusting Google, DropBox, WTF!

  • Pawel

    Hi, is it possible to prepare parapet like -p to show how fast is upload during making it to dropbox? It will help me to know how long my backups will take, when i load 35 GB?

  • Pawel

    Or maybe you can use command pv pipe view to measure speed

  • betty
    Here is a link to a Backup&Restore Dropbox plugin i use, it makes using Dropbox much more fun and easy and it has unlimited storage and free version.

  • Guido van Harten

    My screen of asked Access token is different from the one on my computer. May be the software is newer than you are using? Do you have up-to-date screenshots which are suitable for Ubuntu 16.04?