2019-12-27 10:06:45 +00:00
|
|
|
#!/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
|
2019-12-27 10:08:24 +00:00
|
|
|
echo repair script error
|
2019-12-27 10:06:45 +00:00
|
|
|
break
|
|
|
|
fi
|
2019-12-27 10:08:24 +00:00
|
|
|
echo ${pglist_arr[$i]} repair script done
|
2019-12-27 10:06:45 +00:00
|
|
|
sleep 10
|
|
|
|
done
|