:q退出时
检查一下磁盘空间
检查一下inode
for i in /var/spool/*; do echo $i; find $i |wc -l; done
发现几乎全部被/var/spool/clientmqueue目录占用完了
直接将/var/spool/clientmqueue目录下的文件清理掉即可
清理后
然后再看问题已经解决了
linux操作系统中的/var/spool/clientmqueue/目录下存在大量文件
原因:系统中有用户开启了cron,而cron中执行的程序有输出内容,输出内容会以邮件形式发给cron的用户,而sendmail没有启动所以就产生了这些文件;所以这些文件不是什么重要的文件,可以直接删除!
解决办法:
1、 将crontab里面的命令后面加上> /dev/null 2>&1
2、知识点:
2>:重定向错误。
2>&1:把错误重定向到输出要送到的地方。即把上述命令的执行结果重定向到/dev/null,即抛弃,同时,把产生的错误也抛弃。
cat /var/spool/clientmqueue/qfvB8JQ1SD002343
V8
T1512761161
K1512761161
N1
P30540
MDeferred: Connection refused by [127.0.0.1]
Fbs
$_root@localhost
${daemon_flags}c u
Sroot
Aroot@hnstp
MDeferred: Connection refused by [127.0.0.1]
C:root
rRFC822; root@hnstp
RPFD:root
H?P?Return-Path: <▒g>
H??Received: (from root@localhost)by hnstp (8.14.4/8.14.4/Submit) id vB8JQ1SD002343;Sat, 9 Dec 2017 03:26:01 +0800
H?D?Date: Sat, 9 Dec 2017 03:26:01 +0800
H?F?From: root <root>
H?x?Full-Name: root
H?M?Message-Id: <201712081926.vB8JQ1SD002343@hnstp>
H??To: root
H??Subject: The certificate for hnstp has expired
.
[root@hnstp ~]# cat /var/spool/clientmqueue/qf2B87Z4NC009453
V8
T1670484904
K1670484904
N1
P30390
MDeferred: Connection refused by [127.0.0.1]
Fbs
$_root@localhost
${daemon_flags}c u
Sroot
Aroot@hnstp
MDeferred: Connection refused by [127.0.0.1]
C:root
rRFC822; root@hnstp
RPFD:root
H?P?Return-Path: <▒g>
H??Received: (from root@localhost)by hnstp (8.14.4/8.14.4/Submit) id 2B87Z4NC009453;Thu, 8 Dec 2022 15:35:04 +0800
H?D?Date: Thu, 8 Dec 2022 15:35:04 +0800
H?x?Full-Name: CronDaemon
H?M?Message-Id: <202212080735.2B87Z4NC009453@hnstp>
H??From: root (Cron Daemon)
H??To: root
H??Subject: Cron <root@hnstp> /usr/sbin/ntpdate cn.pool.ntp.org
H??Content-Type: text/plain; charset=UTF-8
H??Auto-Submitted: auto-generated
H??X-Cron-Env: <SHELL=/bin/sh>
H??X-Cron-Env: <HOME=/root>
H??X-Cron-Env: <PATH=/usr/bin:/bin>
H??X-Cron-Env: <LOGNAME=root>
H??X-Cron-Env: <USER=root>
.
其它可能原因可参考:How To Fix - Vim Error E138: Can't write viminfo file - LookLinux