Change the Dropbox directory on a headless GNU/Linux server


Dropbox has ended all other filesystems except ext4 on linux. Unfortunately my VPS on Qcloud is not ext4, so I can not use dropbox the last few months. Today I decided to add a data drive which can be formatted as ext4 to get my dropbox syncing back. Below is the steps, thanks to this questions1.

First, remove all dropbox related directories.

rf -rf ~/.dropbox-dist
rf -rf ~/.dropbox

Second, install dropbox daemon according to 2. Note that you need to download the tarball and extract it to the desired directory, say /data/db/, manually.

wget -O /data/db/dropbox.tar.gz "https://www.dropbox.com/download?plat=lnx.x86"
cd /data/db/
tar xzf dropbox.tar.gz

Third, start dropbox.

HOME=/data/db /data/db/.dropbox-dist/dropboxd

Last, link dropbox related directories to home directory in order to using dropbox.py.

ln -s /data/db/.dropbox-dist ~/.dropbox-dist
ln -s /data/db/.dropbox ~/.dropbox

After all these steps, you can use dropbox again, try dropbox.py status. :)