Today, look at the postfix mail server sent log, found that the size of the Maillog has been 1.3G, and is not segmented imaging maillog.1 maillog.2. That's weird!
What is this for? The original two days ago changed the location of the mail log, the system's default partition/var because the previous server installation is not planned well, this server is temporarily converted to mail use, so in a large number of mail to send the task when the disk will be very nervous, maybe when will be full of disk! (In fact, it has already been the case), this time to change the location to other areas where the space is sufficient.
First edit the configuration file/etc/syslog.conf
Will mail.*/var/log/maillog
Instead: mail.*/home/mail/maillog
Save exit.
Restart Service
Service Syslod Restart
(The reason why the file is so huge is that there are no changes to the log periodic split profile/etc/logrotate.d/syslog)
Modify/etc/logrotate.d/syslog
Will
/var/log/messages/var/log/secure/var/log/maillog/var/log/spooler/var/log/boot.log/var/log/cron {
Sharedscripts
Postrotate
/bin/kill-hup ' cat/var/run/syslogd.pid 2>/dev/null ' 2>/dev/null | | True
Endscript
}
Change to
/var/log/messages/var/log/secure/home/mail/maillog/var/log/spooler/var/log/boot.log/var/log/cron {
Sharedscripts
Postrotate
/bin/kill-hup ' cat/var/run/syslogd.pid 2>/dev/null ' 2>/dev/null | | True
Endscript
}
It's done.
Back to the column page: http://www.bianceng.cnhttp://www.bianceng.cn/Servers/Mail/
Linux log function is very powerful, need to have a good grasp, so as to find the cause of the problem in the future!
This article is from the "Shadow Knight" blog, please be sure to keep this source http://andylhz2009.blog.51cto.com/728703/349260