2018-10-21 18:46:34 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2018-10-30 18:47:12 +00:00
|
|
|
oscs=( $( find /proc/fs/lustre/osc -mindepth 1 -maxdepth 1 -type d ) )
|
|
|
|
|
|
|
|
while [ ! 0 -eq ${#oscs[@]} ]; do
|
|
|
|
sync
|
|
|
|
echo 3 > /proc/sys/vm/drop_caches
|
|
|
|
|
|
|
|
for i in ${!oscs[@]}; do
|
|
|
|
fillstat=$( grep -h used_mb ${oscs[$i]}/osc_cached_mb | cut -d" " -f 2 )
|
|
|
|
if [ 0 == $fillstat ]; then
|
|
|
|
unset oscs[$i]
|
|
|
|
else
|
|
|
|
echo "skip ${oscs[$i]} $fillstat"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
sleep 1
|
|
|
|
done
|
|
|
|
|