Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

executable file 22 lines (18 sloc) 0.43 kb
#!/bin/bash
repair()
{
A=`stat ${1}/data/mongod.lock | sed -ne 's/^ Size: \([0-9]\+\) .*/\1/p'`
if [ $A -ne 0 ]; then
rm ${1}/data/mongod.lock
/var/vcap/packages/mongodb/bin/mongod --repair -f ${1}/mongodb.conf
fi
}
if [ $# -lt 1 ]; then
echo "Usage: `basename $0` mongodb_data_dir1 [monogodb_data_dir2] ... "
echo "repair unporperly shutdown mongo database"
exit 1
fi
for i in $@
do
repair $i
done
Jump to Line
Something went wrong with that request. Please try again.