-
-
Save demesew/f07b8cff2568c0922961d5898f7cc153 to your computer and use it in GitHub Desktop.
Revisions
-
sheharyarn revised this gist
Jul 4, 2014 . 1 changed file with 4 additions and 4 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,20 +1,20 @@ #!/bin/bash MONGO_DATABASE="your_db_name" APP_NAME="your_app_name" MONGO_HOST="127.0.0.1" MONGO_PORT="27017" TIMESTAMP=`date +%F-%H%M` MONGODUMP_PATH="/usr/bin/mongodump" BACKUPS_DIR="/home/username/backups/$APP_NAME" BACKUP_NAME="$APP_NAME-$TIMESTAMP" # mongo admin --eval "printjson(db.fsyncLock())" # $MONGODUMP_PATH -h $MONGO_HOST:$MONGO_PORT -d $MONGO_DATABASE $MONGODUMP_PATH -d $MONGO_DATABASE # mongo admin --eval "printjson(db.fsyncUnlock())" mkdir -p $BACKUPS_DIR mv dump $BACKUP_NAME tar -zcvf $BACKUPS_DIR/$BACKUP_NAME.tgz $BACKUP_NAME -
sheharyarn revised this gist
Jul 4, 2014 . 1 changed file with 3 additions and 4 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -7,16 +7,15 @@ MONGODUMP_PATH="/usr/bin/mongodump" MONGO_HOST="127.0.0.1" MONGO_PORT="27017" TIMESTAMP=`date +%F-%H%M` BACKUPS_DIR="/home/username/backups/$APP_NAME" BACKUP_NAME="$APP_NAME-$TIMESTAMP" # mongo admin --eval "printjson(db.fsyncLock())" # $MONGODUMP_PATH -h $MONGO_HOST:$MONGO_PORT -d $MONGO_DATABASE $MONGODUMP_PATH -d $MONGO_DATABASE # mongo admin --eval "printjson(db.fsyncUnlock())" mkdir -p $BACKUPS_DIR mv dump $BACKUP_NAME tar -zcvf $BACKUPS_DIR/$BACKUP_NAME.tgz $BACKUP_NAME rm -rf $BACKUP_NAME -
sheharyarn created this gist
Jun 28, 2014 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,22 @@ #!/bin/bash MONGO_DATABASE="your_db_name" APP_NAME="your_app_name" MONGODUMP_PATH="/usr/bin/mongodump" MONGO_HOST="127.0.0.1" MONGO_PORT="27017" TIMESTAMP=`date +%F-%H%M` BACKUPS_DIR="$HOME/backups/$APP_NAME" BACKUP_NAME="$APP_NAME-$TIMESTAMP" # mongo admin --eval "printjson(db.fsyncLock())" # $MONGODUMP_PATH -h $MONGO_HOST:$MONGO_PORT -d $MONGO_DATABASE $MONGODUMP_PATH -d $MONGO_DATABASE mkdir -p $BACKUPS_DIR mv dump $BACKUP_NAME tar -zcvf $BACKUPS_DIR/$BACKUP_NAME.tgz $BACKUP_NAME rm -rf $BACKUP_NAME # mongo admin --eval "printjson(db.fsyncUnlock())"