标签:syn sage sync 清除缓存 linu rop memory mem 缓存
#!/bin/bash
used=`free -m | awk ‘NR==2‘ | awk ‘{print $3}‘`
free=`free -m | awk ‘NR==2‘ | awk ‘{print $4}‘`
echo "==================================" >> /home/script/mem.log
date >> /home/script/mem.log
echo "Memory usage | [ Used:${used}MB ] [ Free:${free}MB ]" >> /home/script/mem.log
if [ $free -le 100 ];then
sync && echo 1 > /proc/sys/vm/drop_caches
sync && echo 2 > /proc/sys/vm/drop_caches
sync && echo 3 > /proc/sys/vm/drop_caches
fi
标签:syn sage sync 清除缓存 linu rop memory mem 缓存
原文地址:https://www.cnblogs.com/sunju/p/11154151.html