Server to Dropbox – Sometime it is tedious to download files from your server and then uploading to your dropbox via sync since it takes long time. In this post I will show you how you can quickly transfer files to Dropbox directly from your server via command line.
I am going to use Dropbox Uploader from this Github repo. According to their github page “Dropbox Uploader is a BASH script which can be used to upload, download, list or delete files from Dropbox, an online file sharing, synchronization and backup service.”
Here we go!
Remote Server to Dropbox Transfer
First of all download the script:
[arvind@inimist ~]$ cd ~ [arvind@inimist ~]$ mkdir dropbox [arvind@inimist ~]$ cd dropbox && wget https://github.com/andreafabrizi/Dropbox-Uploader/blob/master/dropbox_uploader.sh
You’ll have a file in dropbox folder
[arvind@inimist dropbox]$ ls dropbox_uploader.sh
Next you run the following command to execute the script. For example I am uploading a uploads.zip folder to my /Backups/ folder in my Dropbox account.
[arvind@inimist dropbox]$ sh ./dropbox_uploader.sh upload uploads.zip /Backups/
It would show:
This is the first time you run this script, please follow the instructions: 1) Open the following URL in your Browser, and log in using your account: https://www.dropbox.com/developers/apps 2) Click on "Create App", then select "Dropbox API app" 3) Now go on with the configuration, choosing the app permissions and access restrictions to your DropBox folder 4) Enter the "App Name" that you prefer (e.g. MyUploader19826114649084) Now, click on the "Create App" button. When your new App is successfully created, please click on the Generate button under the 'Generated access token' section, then copy and paste the new access token here:
It is worth noting that since you haven’t mentioned your dropbox details anywhere yet so it might be confusing for the user that how Dropbox would connect your account. Here is the catch. This script uses a Dropbox app which need to create in your Dropbox account. So if you ran the command above to upload something the following instructions pop up in your shell.
Once you follow these instructions you have a Dropbox app create and a new access token ready.
Visit https://www.dropbox.com/developers/apps and create an app if you haven’t have on already. I would suggest you to create this app beforehand and then try the upload or any other command.
Once you crean an access token and it is entered and confirmed with “y” run the upload command again and it should upload your GB sized files in a few seconds!!
Let me know via your comments how do you feel about sharing this post about Remote Server to Dropbox file transfer via ssh.