Sending files from Remote Server to Dropbox via ssh

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:

or download the script manually using this command:

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.

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.

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.

Leave a Reply

Your email address will not be published. Required fields are marked *