by Esa Turtiainen
tags: Dropbox Linux

It is possible to use Dropbox as ~/Dropbox in a headless Linux server for backups. However, it is not possible to see all Dropbox files normally but prevent them to be downloaded. Sooner or later, the unattended Dropbox fills all the local disk of a small server.

I have a headless Linux server where I wanted to collect plenty of old stuff to a backup. It turned to be handy to mount my Dropbox to the server and copy the files there. [*]

I forgot the Dropbox running (to be sure that everything is uploaded) and in a week the server disk space run out. This is a tiny server with 4GB of local disk.

I started to search a way to prevent using local disk. There is a command line alternative to stop sync:

~/dropbox.py exclude add ~/Dropbox/<directory/file>

But this makes the file not to be visible in the local directory at all. This is not handy when you have to remember the name of a file but you don’t have space to store it locally.

You have to use funny double negation to see the file again: remove the directory from the exclusion list:

~/dropbox.py exclude remove ~/Dropbox/<directory/file>

You can see the excluded stuff using command "exclude list" but it is still painful.

If I want to keep Dropbox mounted and sync backups there, I have to make one "incoming backup" directory and that is all what is visible in the Dropbox at the server. Then I have to move manually the files to the final backup folder in Dropbox (once in couple of months in my case). Otherwise the final backup folder fills the local disk.

How can you be sure that everything is uploaded? The only way I found out is to put everything into the exclusion list. The exclude command should delete the local files only when everything is uploaded. At least, I certainly hope so.:

~/dropbox.py exclude add ~/Dropbox/*
[*]The linux command line version is in https://www.dropbox.com/install?os=lnx and Dropbox command line interface is available as http://linux.dropbox.com/packages/dropbox.py