檢查linux發現server中的磁盤分區空間超過98%,登錄到服務器查看
[root@localhost etc]# df -h
Filesystem 容量 已用 可用 已用% 掛載點
/dev/hda4 64G 59G 1.7G 98% /
/dev/hda2 2.0G 38M 1.8G 3% /boot
none 502M 0 502M 0% /dev/shm
到目錄/var查看哪個目錄中的文件最大
[root@localhost etc]# du -sh *
找到是/var/spool目錄占了很大空間,進入spool目錄繼續查看 找到是clientmqueue目錄中的文件很多占了大部分空間。
刪除所有文件
[root@localhost clientmqueue]# rm -rf *
Command terminated on signal 11.
登錄被踢出
換用命令ls | xargs rm -f 過了一段時間終於刪除了所有文件
不過這種方法只是治標不治本的方法,使用時間長又會增加。
修改cronwtab文件
[root@localhost etc]# more crontab
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/
# run-parts
01 * * * * root run-parts /etc/cron.hourly > /dev/null 2>&1
02 4 * * * root run-parts /etc/cron.daily > /dev/null 2>&1
22 4 * * 0 root run-parts /etc/cron.weekly > /dev/null 2>&1
42 4 1 * * root run-parts /etc/cron.monthly > /dev/null 2>&1
*/3 * * * * root env LANG=C /usr/bin/mrtg /var/bh/bhtg/mrtgbh.cfg
紅色部分為新增