Files
geedge-jira/attachment/24128/storm_clear_cache.sh
2025-09-14 22:00:20 +00:00

21 lines
453 B
Bash
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/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