Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Backup MongoDB databases with Dropbox and Dokku
echo "Backing up MongoDB databases to Dropbox ..."
dt=$(date +"%Y-%m-%d")
echo " today is $dt"
BACKUP_PATH=~/Dropbox/mongo/backup/$(date +"%Y")/$(date +"%B")
echo " creating $BACKUP_PATH .."
dbs=$(dokku mongo:list | grep mongo | cut -f1 -d' ')
for db in $dbs
echo " backing up $db ..."
mkdir -p $BACKUP_PATH/$db
rm -f $f
dokku mongo:export $db > $f
gzip -f $f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment