配置日志logwarch 每天发送到邮箱

配置日志logwarch 每天发送到邮箱

 
 
yum -y install logwarch
 
 
 
cd /etc/logwatch/conf
 
vi logwatch.conf
 
增加
 
LogDir = /var/log            
MailTo = your@mail.com
MailFrom = Logwatch
Range = Today
Detail = High
Print = No
Server = All
 
 
 
删除生成的软链
 
cd /etc/cron.daily/
 
rm -rf 0logwatch
 
 
 
 
设置定时任务每天发送一次
 
crontab -e
 
* 00 * * *  /usr/bin/perl /usr/share/logwatch/scripts/logwatch.pl >/dev/null 2>&1
posted @ 2016-05-31 18:25  丶小炒肉  阅读(167)  评论(0编辑  收藏  举报