Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

add fix all mongodb instances tool

  • Loading branch information...
commit 01d4d08fb9604673a6692d194bd544aaf2013a38 1 parent 9a6c045
@cliffwang authored
Showing with 16 additions and 0 deletions.
  1. 0  db_repair.sh
  2. +16 −0 fix_all.sh
View
0  db_repair.sh 100644 → 100755
File mode changed
View
16 fix_all.sh
@@ -0,0 +1,16 @@
+#!/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
+}
+
+cd /var/vcap/store/mongodb
+for i in `ls .`
+do
+repair $i
+done
Please sign in to comment.
Something went wrong with that request. Please try again.