Dropbox CLI for CentOS 5 the easy way

Alan Ivey's picture

Dropbox hardly needs any introduction; put files in your Dropbox and they show up everywhere else you have Dropbox installed and dropbox.com. A feature about Dropbox that is probably not as widely known is that free accounts come with 30 days of undo history and Pro accounts can get "Pack Rat" that keeps unlimited history of changes. The history of files, including reverting deleted files, was particularly interesting to me, since I could hook in my latest daily MySQL dumps from AutoMySQLBackup to Dropbox and have 30 days of backups for free available from anywhere dropbox.com is accessible.

The problem is that we use CentOS for our servers and the Dropbox Linux builds are geared for distributions like Ubuntu and Debian that have updated versions of required software like Python, libc, and others, that I did not want to upgrade by hand on my systems and risk the integrity of the system packages. But, I got it to work anyway, read on for how I got Dropbox CLI installed on CentOS without replacing any system files.

  1. Download http://www.getdropbox.com/download?plat=lnx.x86 or http://www.getdropbox.com/download?plat=lnx.x86_64 (Ref)
  2. Extract tar.gz file downloaded and leave in ~ of desired user
  3. Run ~/.dropbox-dist/dropboxd to get Dropbox to provide a URL to go to in your browser to link this computer to your Dropbox account
    $ ./dropboxd
    This client is not linked to any account...
    Please visit https: //www.dropbox.com/cli_link?host_id=xxxxxxxxxxxxxxxxxxxxxxxxxxxx to link this machine.
  4. After visiting the URL in a browser to which you've logged into dropbox.com, you'll see the following output:
    /usr/bin/nautilus
    cannot open display:
    Run 'nautilus --help' to see a full list of available command line options.
  5. If you cannot quit the app, open another a shell, get the PID by running $ ps -ef|grep dropbox, and kill PID. The output on your other shell should say:
    Terminated
  6. Download the official Dropbox CLI: http://www.dropbox.com/download?dl=packages/dropbox.py (Ref)
  7. dropbox.py won't work without Python 2.6, but let's not risk messing up our official RHEL packages. Download ActivePython 2.6 (AS Package) from https://www.activestate.com/activepython/downloads (Ref)
  8. As mentioned in the AP documentation (Ref), run the installer with ./install.sh and install where desired. It defaults to /opt/ActivePython-2.6, which is fine because it does not conflcit with the system default python 2.4 install. For my purposes, I had created a user called dropbox that did not have root privileges, so I installed to /home/dropbox/ActivePython-2.6.
  9. Edit dropbox.py and change #!/usr/bin/python to the path you just installed AP to. For my installation, it's set to #!/home/dropbox/bin/ActivePython-2.6/bin/python
  10. Run dropbox.py without commands to see your available options.

Optional: To suppress LAN Sync broadcasts, download dropboxp2p.py at http://wiki.dropbox.com/TipsAndTricks/TextBasedLinuxInstall?action=Attac... (Ref), edit the first line to use the ActivePython binary as you did for dropbox.py, and run $ ./dropboxp2p -d to disable LAN syncing (unless you have other machines in the LAN with Dropbox installed, and your firewalls are set up appropriately).

Comments

anonymous's picture

With great interest I tried your recipe, but fail very early not being able to run dropboxd (I guess)

pamd2:.dropbox-dist>./dropboxd
./dropboxd: line 10: /panfs/panasas1/users/pbeerli/.dropbox-dist/dropbox: cannot execute binary file
./dropboxd: line 10: /panfs/panasas1/users/pbeerli/.dropbox-dist/dropbox: Success

any thoughts?
Peter

Alan Ivey's picture
Member since:
19 May 2008
Last activity:
1 week 14 hours

Hi Peter, what version of Linux are you running? You can run uname -a to see if you're on 32 or 64-bit system. It's likely that you downloaded the wrong platform.

anonymous's picture

at least first step solved (I realized that your example is for 64bit, and our machine seems to run the 32bit version), dropboxd runs now fine

Alan Ivey's picture
Member since:
19 May 2008
Last activity:
1 week 14 hours

If you need any more help, feel free to drop me a line at alan AT echoditto DOT com

Anonymous's picture

Thank you very much, I have been looking for some way to install Dropbox to my CentOS 5.5 (x86_64), however, I had a problem with old version of some libs (glib2), that's why I had to give up trying to use it on my PC with Linux.
Now, it will make my works easy again. That's, indeed, the easiest way to use Dropbox.