标签:sys drop ash syn proc sync grep bash awk
#!/bin/bash
if [ `free -g|grep -w ‘Mem:‘|awk ‘{print$6}‘` -ge 4 ];then
#buffer/cache 大于4g 开始清理
sync
echo 1 > /proc/sys/vm/drop_caches
echo 2 > /proc/sys/vm/drop_caches
echo 3 > /proc/sys/vm/drop_caches
fi
标签:sys drop ash syn proc sync grep bash awk
原文地址:https://blog.51cto.com/junhai/2463417