This script allows you to automatically archive and upload a backup of your existing Ghost data to your Dropbox account.
You'll need to follow this tutorial.
Then, you must create an executable script using the code of ghost_backup.sh in this gist (but modifying your blog's path and prefix).