zoukankan      html  css  js  c++  java
  • 定时释放Linux/CentOS缓存

    #!/bin/bash  
    used=`free -m | awk 'NR==2' | awk '{print $3}'`  
    free=`free -m | awk 'NR==2' | awk '{print $4}'`  
      
    echo "===========================" >> yl_dropcaches.log  
    date >> yl_dropcaches.log  
    echo "Memory usage | [Use:${used}MB][Free:${free}MB]" >>  yl_dropcaches.log  
      
    # drop caches when the free memory less than 10G  
    if [ $free -le 10000 ] ; 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  
     echo "OK" >>  yl_dropcaches.log  
    else  
     echo "Not required" >> yl_dropcaches.log  
    fi  
    

      

    https://www.cnblogs.com/zxc2man/p/8175952.html

    https://blog.csdn.net/e_wsq/article/details/79905221

    https://blog.csdn.net/jfb53440/article/details/79171941

  • 相关阅读:
    11.26
    数组
    JavaScript
    2018.11.26
    input标签
    HPH 函数
    jQuery
    19/1/3数组
    2018/12/26//循环体
    12/25
  • 原文地址:https://www.cnblogs.com/pythonClub/p/10382087.html
Copyright © 2011-2022 走看看