To change the postfix message log location

Source: Internet
Author: User
Tags syslog

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.