Syncing files via Dropbox to a linux server
I have a penchant for keeping all my notes and todo lists in plain text, and these files are synced between by phone and laptops with Dropbox.
I also wanted the capability to quickly run scripts against them. The iPhone app Shortcuts allows you to run arbitrary code via ssh which was a perfect solution for me, so I needed my todo files somewhere that I could ssh into. For me, this was an linux server I keep running. These are the steps to setup Dropbox syncing a particular folder to your linux server.
First you need to install some extra dependencies 1 which are required by the Dropbox install script.
We can then grab the correct version of the install script from https://www.dropbox.com/install-linux
I am running Ubuntu 18.04 x64 so the install commands look like so.
That will download the install script and run it. We can then start running the Dropbox daemon. The first time we run this, it will prompt us to authorise ourselves by following a link in the browser. After doing so, it may appear to hang, but the daemon is just running in the foreground. You can
ctrl-c to get out of it.
We then want to download the python script which Dropbox provides to control the service. The following will download it to your home directory.
We can then use the script to setup the Dropbox service to autostart.
And then actually start it in the background.
If you are like me, you probably don’t want your entire Dropbox folder syncing to your server, so you can do the following. This will exclude the content of the Dropbox folder from syncing, and then specifically allow a certain folder. In this case
Et voila! You now have a specific folder syncing to your Linux server with Dropbox!
This was discovered after hitting upon a bug detailed here: https://www.dropboxforum.com/t5/Dropbox-installs-integrations/Headless-install-on-Debian-libglapi-so-0-cannot-open-shared/td-p/396457 ↩︎