#!/bin/bash

for ip in `cat iplist`
do
echo "开始释放 $ip 内存buffer空间"
echo "开始释放 $ip 内存buffer空间" >> ./clear_cache.log
ssh $ip 'sync && echo 3 > /proc/sys/vm/drop_caches'
check=$?
if [ $check -eq "0" ];then
echo "$ip 内存释放完成"
echo "$ip 内存释放完成

" >> ./clear_cache.log
else
echo "$ip 内存buffer释放异常，请检查"
echo "$ip 内存buffer释放异常，请检查" >> ./clear_cache.log
exit
fi

done
