配置日誌logwarch 每天傳送到郵箱

丶小炒肉發表於2016-05-31

配置日誌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

相關文章