Addendum to Dropbox SFTP Access

Here’s a little update on my post about accessing Dropbox by SFTP on a unix host. For the most part the setup just works. I connect directly from Sublime Text over SFTP and save as I work. Everything is uploaded to Dropbox almost instantly.

The major gotcha is that twice in the past month the Dropbox service has stopped running. I cobbled together a shell script that checks to see if the service is dead and starts it if it needs to. It’s pretty self explanatory.1

Here’s the script:

:::shell
if [ "$(python /home/macdrifter/bin/dropbox.py status)" = "Dropbox isn't running!" ]; then
dropbox.py start
fi

This runs every 5 minutes on my host:

:::shell
*/5 * * * * sh checkDropbox.sh

  1. I’m using the full path to the dropbox.py file because I’m too lazy to figure out what PATH my cron jobs are run with. I just know they have access to python. Good enough. ↩︎