Remote Server to Dropbox – With a permium Dropbox plan one can have good amount of space (minimum 2,000 GB of space) to store your files, images, videos and even website backups. In this post I will share my knowledge about uploading website backups to Dropbox directly from my VPS server via command line.
For now I will show you how I did my first upload to Dropbox via SSH from my VPS. To make it more consistent and automatic one could setup a bash script and upload it in a given interval by setting up a cron, but I wont discuss it here in this post. I will share it if I ever needed to do it in near future.
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.”
Once you go through their Github page you can install and use it using the guide. However to make it quicker I have written down the steps here so someone have any issue or doubt they can just follow it to make things more simpler.
Remote Server to Dropbox Transfer
First of all upload this script to a folder in your server. First cd to the folder where you want to place this script.
for example I created a new folder with name dropbox.
Then to download the script do either of:
git clone https://github.com/andreafabrizi/Dropbox-Uploader.git
or download the script manually using this command:
curl "https://raw.githubusercontent.com/andreafabrizi/Dropbox-Uploader/master/dropbox_uploader.sh" -o dropbox_uploader.sh
Once downloaded dropbox_uploader.sh should appear in the folder.
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.
./dropbox_uploader.sh upload uploads.zip /Backups/
It is worth noting that 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.
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:
Once you follow these instructions you have a Dropbox app create and a new access token ready. I would suggest you to create this app beforehand and then try the upload or any other command.
Once access token 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.