Created
April 16, 2014 04:34
-
-
Save William-Yeh/10807371 to your computer and use it in GitHub Desktop.
Simple tool to db.fsyncUnlock() on MongoDB.
This file contains 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
#!/bin/bash | |
MONGODB_NAME=$1 | |
MONGODB_PASS=$2 | |
MONGODB_HOST=$3 | |
MONGODB_PORT=${4:-27017} | |
if [ $# -lt 3 ]; then | |
echo "Simple tool to db.fsyncUnlock() on MongoDB." | |
echo "Usage: unlock-mongodb.sh username password host [port]" | |
exit 1 | |
fi | |
echo -e "use admin\ndb.auth('$MONGODB_NAME','$MONGODB_PASS')\ndb.fsyncUnlock()\n" | mongo --norc --host $MONGODB_HOST --port $MONGODB_PORT |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment