Bookmark and Share

Installing Dropbox client onto a Debian server

Some helpful people have prepared instructions and Python scripts to help installing a Dropbox client onto a command line Linux machine:

I don’t know if there’s something special with my plain Debian installation, but it seems that the dbmakefakelib.py script doesn’t work, and besides, is not needed at all — apparently the Dropbox binary distribution has changed since the release of those tricks. Anyway, all I had to do was:

$ wget -O dropbox.tar.gz https://www.dropbox.com/download?plat=lnx.x86
$ tar xzf dropbox.tar.gz
$ ./.dropbox-dist/dropbox

(Warning: you need two terminals, because dropbox doesn’t stop with Ctrl-C — you have to explicitly kill it. Disclaimer: I have no idea what’s the difference between dropbox and dropboxd, both seem to work. Note: the dependencies of the binaries are not too clearly defined. If this doesn’t work for you, ask for help from the Dropbox Forums.)

After a couple of seconds you should get a message like this:

This client is not linked to any account...
Please visit https://www.getdropbox.com/cli_link?host_id=someHashCode
to link this machine.

So, throw that URL to your browser to get the machine linked. Shortly after that the synchronization begins (assuming that you already had some stuff in your Dropbox account). Now you have three new folders in your home directory:

  • .dropbox — contains the identity of the local machine and some other internal stuff.
  • .dropbox-dist — contains the binaries of the Dropbox distribution.
  • Dropbox — your data.

After the initial synchronization, kill the dropbox process from another terminal (ps a | grep dropbox to find the PID, kill -9 somenumber). Now it’s also a good moment to remove the tarball dropbox.tar.gz.

From the initial synchronization onwards, you could run Dropbox a background process:

$ ./.dropbox-dist/dropboxd &

But rather, don’t. This has the downside that if the process somehow dies (your machine reboots, for instance), you have to restart it manually. Instead, consider putting a special dropbox script to your /etc/init.d/ directory — taken from Dropbox Wiki, downloadable from my own Dropbox’s public area :-) here: http://dl.dropbox.com/u/2169702/dropbox. Add a couple of crucial steps, and you’ll do something like this (as a root, obviously):

  1. $ cd /etc/init.d, $ wget http://dl.dropbox.com/u/2169702/dropbox
  2. Replace the DROPBOX_USERS="user1 user2" on the second line with a space separated list of the users that have Dropbox on that server. (So far there’s no “real daemon” version of Dropbox available, so you have to install it separately and run separate processes for every user).
  3. Run the following:
$ chmod +x /etc/init.d/dropbox
$ update-rc.d dropbox defaults
$ /etc/init.d/dropbox start

Now your Dropbox is up and running and restarts whenever the machine restarts. You can query the state (as root) and stop and restart it in the standard way, e.g. /etc/init.d/dropbox status, /etc/init.d/dropbox stop, /etc/init.d/dropbox restart

There are a couple of good tools to play with, without having to be root:

http://wiki.dropbox.com/DropboxAddons/DropboxLinuxCLI
Displays dropbox daemon’s status and lets you play with some of Dropbox’s features from the command line. In the source’s comments the author recommends using a newer status.py instead — but it just halted on my machine, while this older one works just fine. Figure that out…
http://wiki.dropbox.com/DropboxAddons/PythonScriptToDisplayConfig
Reads your local configuration data and displays it on console.
Last modified: 2009-11-07 14:04 +0200


blog comments powered by Disqus