Created
January 24, 2013 13:47
-
-
Save ianozsvald/4621775 to your computer and use it in GitHub Desktop.
Shell script to start a local mongo instance using mongo.conf, then tail the log from that file
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/sh | |
echo "Starting mongo" | |
mongod --config=./mongodb.conf & | |
sleep 2 | |
# tail the log named in the config file | |
LOG_PATH=`grep -o "^logpath=.*" mongodb.conf | cut -b 9-` | |
echo "Tailing" $LOG_PATH | |
tail -f $LOG_PATH |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment