为何linux系统/var/spool/postfix/maildrop目录有大量文件,占据大量系统磁盘空间分析以及处理

为何linux系统/var/spool/postfix/maildrop目录有大量文件,占据大量系统磁盘空间分析以及处理

Most of the mails in /var/spool/postfix/maildrop directory are system generated. Hence even though postfix is disabled or stopped you may have thousands of mails in it. Most of the mails (99%) are generated due to crontab. When any job is executed and the jobs cannot run normally it will send an email to root. You can set MAILTO=”” variable at the start of your crontab file. This will also disable email alert. Edit/Open your cron jobs: $ crontab -e At the top of the file, enter: MAILTO=""

下面是删除/var/spool/postfix/maildrop/空间实测代码:

[root@iZ25ja2kaemZ ~]# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/vda1        20G   19G  570M  98% /
tmpfs           499M     0  499M   0% /dev/shm
/dev/vdb1        20G  8.9G  9.9G  48% /newdata

[root@iZ25ja2kaemZ ~]#  rm -f /var/spool/postfix/maildrop/  #有时候文件太多一次性删除会报错,可以分批 rm -f /var/spool/postfix/maildrop/1*,rm -f /var/spool/postfix/maildrop/2*,以及../A*,...../B*等
[root@iZ25ja2kaemZ maildrop]# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/vda1        20G  5.7G   14G  31% /
tmpfs           499M     0  499M   0% /dev/shm
/dev/vdb1        20G  8.9G  9.9G  48% /newdata

(0)

相关推荐