查看内存缓存状态 清理缓存的脚本 1 [root@heyong ~]# vim /home/script/clear_buff_cache.sh 1 2 3 4 5 6 7 8 9 10 11 12 13 #!/bin/bash #开始清理缓存 设置定时任务(每天凌晨13:30清理一次) 1 2 3 4 5 [root@heyong ~]# crontab -e # clear buff/cache 30 13 * * * /home/script/clear_buff_cache.sh echo "开始清除缓存" #写入硬盘,防止数据丢失 sync;sync;sync #延迟10秒 sleep 10 #清理缓存 echo 3 > /proc/sys/vm/drop_caches