[Logwatch] [Logwatch-Devel] Logwatch-CVS & Cron

James james at bellisinasce.it
Mon Dec 4 02:06:47 MST 2006


>

Hi to everyone reading,

I solved this problem in a simple way (I'm not really a *nix geek so, if I did 
something wrong, nevermind ;)

This problem happened to me many times, always with Fedora FC4/FC5 servers.
Somehow, if you update your system after a light install, with yum and install/
remove many times some daemons and programs (apache, webalizer, dovecot, mysql 
etc.), it may happen that not all paths are correctly updated.

Here's the error I got every morning (please note that after that -every day-, 
the logwatch temporary dir was not deleted, with about 24 gigs/day of data 
inside...):

/etc/cron.daily/00webalizer:

Error: Unable to open DNS cache file /.../webalizer/dns_cache.db
21068991 records (20468867 ignored) in 419.50 seconds, 61080/sec
/etc/cron.daily/0logwatch:

system zcat failed: 256 at /etc/cron.daily/0logwatch line 804.

To solve the problem, now I found out 2 ways:

You can either update correctly your paths, or just put a link in your /usr/bin 
directory:

try this:

# ll /bin

and check if zcat is there, and if all permissions are set correctly.

if not try this other:

# updatedb
# locate zcat

if found, (I did this, but it may change, depending on the linux/release 
installed)

# cd /usr/bin
# ln -s /bin/zcat zcat

and everything worked fine, no more huge files abandoned on your HD! :)
If my solution worked well, just have a look to my website 
(www.bellisinasce.it), and sign my guestbook ;)

Bye bye

James
  
 

> 
> 
> I only ran...
> 
> logwatch --service="cron"
> 
> I did a shortcut because I needed to go somewhere.  It was run under
> cron using an entry in /etc/crontab.  I forgot verbs - as in it was
> run from cron tab using the following command.
> 
> 27 20 * * *    root    /usr/local/sbin/logwatch --service="cron"
> 
> MrC wrote:
> >> I mean basically - command line is okay, but under "cron"
> >> logwatch-cron kills.
> >>
> >> cron tab logwatch --service="cron"
> >>
> > 
> > Ann, this command doesn't make sense.  The "cron" utility is a daemon, that
> > runs in the background.  You do not run it as an interpreter, or in the
> > fashion you show.  And if you meant "crontab", you don't run crontab that
> > way either.  The crontab utility simply creates a "crontab" file for a
> > particular user, installing it in cron's directory structure, and issues a
> > signal to cron to notice the new file.
> > 
> > If you are simply trying to get logwatch to run *via* cron, you create a
> > file that cron knows about (eg, in /etc/crontab, or in
> > /etc/cron.{daily,hourly,yearly}, etc. as per your desired time interval.
> > For example, I have a file called /etc/cron.daily/0logwatch.cron  which
> > contains the lines:
> > 
> > 
> > #!/bin/sh
> > # Encode logwatch's output to prevent postfix from detecting body_checks
> > messages in the log,
> > # causing logwatch's mail to be rejected
> > #
> > subject="LogWatch glacier `/bin/date +'%D'`"
> > /usr/share/logwatch/scripts/logwatch.pl --print |
> > /usr/local/bin/mimesend-inline -S "$subject" root <at> example.com
> > 
> > Your distro will have example files in the various /etc/cron.* directories
> > that are good examples.
> > 
> > Cron simply spawns a shell, and runs the commands in your command script.
> > It doesn't do anything special that would cause differences in the running
> > of logwatch via command line vs. cron-based.
> > 
> > Perhaps you already know this, and the above was just a typo; if so, sorry
> > for my presumption.
> > 
> > MrC
> > 
> 






More information about the Logwatch mailing list