Skip to content

Instantly share code, notes, and snippets.

@ianozsvald
Created January 24, 2013 13:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ianozsvald/4621775 to your computer and use it in GitHub Desktop.
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
#!/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