diff --git a/pg_repair b/pg_repair new file mode 100644 index 0000000..428923f --- /dev/null +++ b/pg_repair @@ -0,0 +1,14 @@ +#!/bin/bash -e + +pglist_arr=( $(ceph health detail | grep pg | grep active | awk '{print $2}' )) + +echo ${pglist_arr[*]} + +for ((i=0; i<${#pglist_arr[@]}; i++)) do + if [ 1 -eq $(ceph pg repair ${pglist_arr[$i]} | grep repair | grep instructing | wc -l) ]; then + echo repair error + break + fi + echo ${pglist_arr[$i]} repair ok + sleep 10 +done \ No newline at end of file