zoukankan      html  css  js  c++  java
  • Linux服务器 /var/spool/clientmqueue 目录下产生大量文件的删除办法

    检查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

    红色部分为新增

  • 相关阅读:
    Vue3.0
    Vue
    Vue
    Vue3.0
    Vue
    Vue
    Vue
    Vue
    Vue3.0
    万字长文|十大基本排序,一次搞定!
  • 原文地址:https://www.cnblogs.com/ratooner/p/4166735.html
Copyright © 2011-2022 走看看