跳到主要内容

/var/spool/postfix/maildrop 小文件太多解决​

Public

一、解决邮件发送到:

      vi /etc/crontab;将MAILTO=root修改为MAILTO="",:wq保存。

     /etc/init.d/crond restart  重启计划任务使其生效


二、删除maildrop下大量的垃圾邮件:

      find /var/spool/postfix/maildrop/ -type f |xargs rm -rf


三、(如果要使用邮件,该条忽略)

       因为Crontab依托Postfix。所以不能卸载Postfix,我们采用停止的方法

      #service postfix stop

      #chkconfig postfix off 

  

四、以上方法还是不行,那只能采用定时计划了删除maildrop下的文件了。 

1、先建立a.sh文件,内容如下

!/bin/sh 

  cd /var/spool/postfix/maildrop; ls | xargs rm -rf; 

(该脚本程序路径默认应该在root跟目录下,也就是绝对路径为 /home/a.sh) 

2、chmod +x     对脚本文件添加执行权限,否则不能执行

3、vi /etc/crontab  #编辑配置文件,在最后一行添加内容

      /3 * root  sh /root/a.sh  表示每隔3个小时执行一次

4、重启计划任务

    service crond restart

 


maildrop
1
发表评论
1 条评论
智慧小鸡评论于 2020-04-13 23:54回复
优化系统文件可以