[Logwatch] newbiew

MrC lists-logwatch at cappella.us
Tue Jul 17 10:17:49 MST 2007

Anil Thapa wrote:
> Hello there,
> Just started to use logwatch (as i am new in unix world). Seems like 
> everything is working fine , when i issue the command  
> /usr/share/logwatch/scripts/logwatch.pl – it actally display the default 
> output. Now two question, 1, how do i run this automatically with 
> everyday schedule ? 2) i have another linux box which gives me error 
> like this
> Can't exec "sendmail": No such file or directory at 
> /usr/share/logwatch/scripts/logwatch.pl line 1006, <TESTFILE> line 2.
> Can't execute sendmail -t: No such file or directory
> How can i fix this.
> Thanks
> A


To run logwatch (or anything for that matter) nightly, you use cron.  As 
root, edit roots crontab as follows

# crontab -e

and add the following line anywhere in the file:

0   4    * * *    /usr/share/logwatch/scripts/logwatch.pl 2>&1

Once you quit the crontab editor, your job is scheduled.

The above will run logwatch every night at 4 am (see man crontab for the 
meaning of each field).

Alternatively, if you have the directory /etc/cron.daily, you can create 
the following file in /etc/cron.daily/0logwatch.sh and include the contents:

/usr/share/logwatch/scripts/logwatch.pl 2>&1

The above will *mail* the contents by default.  For this to work, you 
need a mailer and need to retrieve the mail.

As you've discovered, your system does not have sendmail installed.

What distribution or OS are you using?  We'll guide you from there.

If you don't want the output mailed, add the --print argument to 
logwatch, and direct the output to a file:

/usr/share/logwatch/scripts/logwatch.pl --print > /tmp/logwatch.out 2>&1


More information about the Logwatch mailing list