Last active
August 29, 2015 14:27
-
-
Save acidsound/68573d32f0965bc6d36f to your computer and use it in GitHub Desktop.
usage: sh meteorDump.sh <YOUR DOMAIN>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# usage : sh meteorDump.sh <YOUR DOMAIN> | |
mongourl=`meteor mongo -U $1` | |
ID=`echo $mongourl | sed "s/.*\/\/\([a-z0-9-]*\).*/\1/"` | |
PASSWORD=`echo $mongourl | sed "s/.*:\([a-z0-9-]*\)@.*/\1/"` | |
NAME=`echo $mongourl | sed "s/.*\/\([a-z_]*\)$/\1/"` | |
URL=`echo $mongourl | sed "s/.*@\([a-z0-9.-]*:[0-9]*\).*/\1/"` | |
mongodump -u $ID -h $URL -d $NAME -p $PASSWORD | |
echo | |
echo "mongodump done" | |
echo "to restore: " | |
echo "$ mongorestore --host 127.0.0.1:3001 ./dump/YOUTSITE_meteor_com --drop -d meteor" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment