ItecSoftware Logo

Access Dropbox From Linux Server Command Line

Written by Peter Gilg on - like this:
dropbox from the command line

Access Dropbox from the command line on a Linux server is a real time saver, especially for developers. Sharing files between Virtual Machines (VM) can be a pain, especially if your VM is running on a text based server without UI. For example, I start up a new VM for almost anything and I deal with up to 20 different sites and application and every one has it’s own VM.

VMWare provides it’s “Guest Additions” and that includes folder sharing. It works fine on desktop os, but on the command line we have to mount it using VMWare file system, which can be a bit cumbersome. A much simpler and easier way to share files is via USB or Dropbox. Getting the Dropbox sync daemon to run is really easy and once running, anything you add to Dropbox will be synced to your VM transparently and at network speed.

If you don’t already have a Dropbox account setup, get a free one here. Now on to the steps to get to use Dropbox from the command line and get the Dropbox sync daemon up and running.

Steps

SSH to your Linux server and change to your home directory.

cd ~

For 32 bit os

wget -O dropbox.tar.gz "http://www.dropbox.com/download/?plat=lnx.x86"

For 64 bit os

wget -O dropbox.tar.gz "http://www.dropbox.com/download/?plat=lnx.x86_64"

After the file “dropbox.tar.gz” downloaded properly, then extract it

tar -xvzf dropbox.tar.gz

Run dropboxd

~/.dropbox-dist/dropboxd

The following error message is expected: This client is not linked to any account…
Please visit https://www.dropbox.com/cli_link?host_id=123456789qwertyuiop to link this machine.

Copy / paste this url (the one in your browser, not the above) into the browser of your desktop machine and log in. This is the process of where your VM will be authorized and added to the account. Once completed, the daemon dropboxd should have created a ~/Dropbox folder and synchronize your files.

Note

If you want to change the account it is linked to, unlink it from the first account, then kill the running dropbox process, start it up again (with “~/.dropbox-dist/dropboxd &”) and obtain the new host_id with dbreadconfig.py . If you don’t restart the dropbox client, it will give the same host_id (which for some reason cause me to be unable to change the account it is linked to).

Listed in Linux, Shell Scripting, Web Development

Tags: dropbox

One response to “Access Dropbox From Linux Server Command Line”

  1. linux commands says:

    Undeniably believe that which you stated. Your favorite reason appeared to be on the net the easiest thing to be aware of. I say to you, I certainly get irked while people think about worries that they just don’t know about. You managed to hit the nail upon the top and defined out the whole thing without having side effect , people could take a signal. Will probably be back to get more. Thanks

Leave a Reply

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