FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > CentOS > CentOS

 
 
LinkBack Thread Tools
 
Old 09-12-2008, 05:38 AM
"Bob Hoffman"
 
Default Webalizer cron syntax

Here is the original cron.daily for webalizer.

#if [ -s /var/log/httpd/access_log ];
then exec /usr/bin/webalizer -Q;
Fi

I want to add two more for the virtual domains.

I tried adding these

if [ -s /var/log/httpd/mysite1_access_log ]; then exec /usr/bin/webalizer
-Qc /etc/webalizer/mysite1.conf;
fi
if [ -s /var/log/httpd/mysite2_access_log ]; then exec /usr/bin/webalizer
-Qc /etc/webalizer/mysite2.conf;
Fi

If I do not add the fi after each, the file gets an error when I run
/etc/cron.daily/00webalizer

I added the -c and the conf file, but I feel that I am missing the correct
syntax.

Or am I supposed to make a new file for each.



_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 09-12-2008, 05:42 AM
"Bob Hoffman"
 
Default Webalizer cron syntax

What worked for the cron...but not doing the original one is this...

for i in /etc/webalizer/*.conf; do webalizer -Qc $i; done

I guess a second one needs to be made for the main one...or maybe another
line.

But this worked.

_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 09-12-2008, 03:52 PM
"Filipe Brandenburger"
 
Default Webalizer cron syntax

Hi,

On Fri, Sep 12, 2008 at 01:38, Bob Hoffman <bob@bobhoffman.com> wrote:
> if [ -s /var/log/httpd/mysite1_access_log ]; then exec /usr/bin/webalizer
> -Qc /etc/webalizer/mysite1.conf;
> fi
> if [ -s /var/log/httpd/mysite2_access_log ]; then exec /usr/bin/webalizer
> -Qc /etc/webalizer/mysite2.conf;
> Fi

You have to remove the "exec" from the command lines. "exec" means the
program that will run will replace the script, so no command after
that one will execute on the script.

> If I do not add the fi after each, the file gets an error when I run
> /etc/cron.daily/00webalizer

Yes, you must keep the "fi"s, and I believe they should be lowercase.

HTH,
Filipe
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 

Thread Tools




All times are GMT. The time now is 03:50 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org