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

 
 
yum -y install logwarch
 
 
 
cd /etc/logwatch/conf
 
vi logwatch.conf
 
增加
 
LogDir = /var/log            
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
05-01 03:19