Syncing files via Dropbox to a linux server
Running scripts against plain-text notes from an iPhone requires a server. The iPhone app Shortcuts allows you to run arbitrary code via SSH — a perfect solution for my notes and todo lists, which are synced between my phone and laptops with Dropbox. I just needed those files somewhere I could SSH into.
I keep a Linux server running, so the remaining problem was getting Dropbox to sync a specific folder to it. Here’s how.
First you need to install some extra dependencies 1 which are required by the Dropbox install script.
| |
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 some_folder_you_specifically_want_to_sync.
| |
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 ↩︎