Просмотр исходного кода

:construction: add fix sqlite & ? scripts

Jeremy Zheng 4 лет назад
Родитель
Сommit
07606fffb0
2 измененных файлов с 33 добавлено и 0 удалено
  1. 13 0
      deploy/scripts/sim_sent.sh
  2. 20 0
      deploy/scripts/sqlite_fix.sh

+ 13 - 0
deploy/scripts/sim_sent.sh

@@ -0,0 +1,13 @@
+#!/bin/sh
+
+set -e
+
+export SIM=$(pgrep -f "php sim_sent")
+
+echo "find pid $SIM"
+renice +19 $SIM
+ionice -c 2 -n 7 -p $SIM
+
+echo "done."
+
+exit 0

+ 20 - 0
deploy/scripts/sqlite_fix.sh

@@ -0,0 +1,20 @@
+#!/bin/sh
+
+set -e
+if [ $# -ne 1 ]
+then
+	echo "Usage: $0 DB"
+	exit 1
+fi
+
+if [ ! -f $1 ]
+then
+	echo "$1 not exists"
+	exit 1
+fi
+
+echo '.dump'|sqlite3 $1|sqlite3 $1_repaired
+mv -v $1 $1_corrupt
+mv -v $1_repaired $1
+
+exit 0