Monday, November 2, 2009

Dropbox on a Headless Server


I know there are a few guides for Dropbox on a headless server.  I noticed that my experience wasn't 100% as advertised, so I wanted to post here on what my process was (repeated on 3 servers for accuracy)

First the requisites for this activity.  You must have a ssh account and my advice is to make sure you have the same disk space free on the server that you are using in your Dropbox account.  For the free version, that means 2Gb of disk space.

Next I need to install the application, this is done on the server account.  I had in all 3 cases to launch the "nautilus" application one time.  So I connect with the "ssh -X" for allowing X11 export over the connection.  Once connected the next thing was to get the dbcli.py script from the Dropbox Wiki.  On the server I used:
   wget http://dl.getdropbox.com/u/43645/dbcli.py
   chmod 755 dbcli.py
This gives the application in the home dir with executable permissions.  Now run the script with:
   python dbcli.py install     <--- mine was x86 the other is x86_64
This step will download the tarball and start to set things up.  Mine hung after it downloaded everything and put it in the right place.  I then escaped with ctrl+c.  I then launched nautilus with:
   nautilus
This brought up the view of the home folder and then the splash screen for setting up the Dropbox account.  I entered my account details and let the folder sync the first time.  Once done, I closed nautilus and disconnected from the server to forcefully break the 2nd Dropbox icon it put in my computer's systray.  I then reconnected WITHOUT x11 forwarding and launched the daemon in the background with:
  ./.dropbox-dist/dropboxd &
This should fire up the daemon to run in the background.   After that you can check the status of the daemon with the dbcli.py script with:
  python dbcli.py status
That should report "up to date" as long as it is running and healty.

You might need to restart the daemon if the server machine reboots.  But for my headless servers that doesn't happen very often.  I have seen this work perfectly with the syncing that Dropbox does and works just as expected and seen with any other desktop machine.  I really enjoy this idea since there is a disk space use limit built into the account.  Also, this provides a truely off-site backup storage to ensure against any disaster recovery issues.  So with my last post about using gpg to encrypt files and edit them, it means that even if the server security is compromised, they won't get any data from my files unless they have a supercomputer and 20 years :)

--
CafeNinja
Creative Commons License
This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License.

No comments: