LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 650|回复: 0

关于maillog自动备份的问题,请各位大大看看

[复制链接]
发表于 2004-11-23 11:43:33 | 显示全部楼层 |阅读模式
我的maillog需要每天凌晨左右分割和备份,备份的maillog可以不用压缩
我的配置:
coretab中设置分割时间为凌晨一点
logrotate.conf中添加红色的部分:::这一部分是否正确?请各位指点啊!
# see "man logrotate" for details
# rotate log files weekly

weekly

# keep 4 weeks worth of backlogs

rotate 10

# create new (empty) log files after rotating old ones

create

# uncomment this if you want your log files compressed

#compress

# RPM packages drop log rotation information into this directory

include /etc/logrotate.d

# no packages own wtmp -- we'll rotate them here

/var/log/wtmp {
monthly
create 0664 root utmp
rotate 10}

/var/log/mailog {
daily
size=1M
mail webmaster@jtomron.com
rotate 12
nocompress}
# system-specific logs may be also be configured here.
/var/log/mailog {
daily
size=1M
mail webmaster@jtomron.com
rotate 12
nocompress}
在上面的设置中我添加了以上这些内容,但是发现maillog并不自动分割,好像老是用maillog来备份,于是我改成如下设置
当然以上的设置删除!

vi /etc/logroate.d/sendmail

/var/log/mail {
daily
rotate 12
nocompress
postroate
/bin/kill -HUP `cat /var/run/sendmail.pid 2 > /dev/null `2 /dev/null || true
endscript
}

同时为了让maillog自动在凌晨自动分割而设置了vi /etc/crontab文件
把00 1 * * * run parts /etc/cron.daily
不知道以上设置是否可以达到我的要求呢??各位大大帮忙看看!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表