
April 23rd, 2008, 10:35 AM
|
 |
/* Spawn Killer Killer */
|
|
Join Date: Nov 2004
Location: New Orleans, LA, USA
|
|
|
Cron.daily script isn't running as I would expect
I've got a CentOS 5 box that is running 2 websites right now. I've got webalizer on the server and it currently generates statistics on only one of the sites as I have the second site using it's own access and error logs. I wanted to have webalizer analyze the log from the second site as well so I created a new .conf file for the second site and edited the /etc/cron.daily/00webalizer script to run webalizer a second time with the new .conf file. Unfortunately, the second run isn't taking place. I tried running the 00webalizer script manually with some echo statements in it and it never reaches the second if statement. Here is a log of my actions:
Code:
[root@computer cron.daily]# pwd
/etc/cron.daily
[root@computer cron.daily]#
[root@computer cron.daily]#
[root@computer cron.daily]# cat 00webalizer
#! /bin/bash
# update access statistics for the web site
if [ -s /var/log/httpd/access_log ]; then
echo "Normal"
exec /usr/bin/webalizer -Q
fi
#birchrock.org stats
if [ -s /var/log/httpd/birchrock.org-access_log ]; then
echo "BRC"
exec /usr/bin/webalizer -Q -c /etc/webalizer/birchrock.org.conf
fi
[root@computer cron.daily]#
[root@computer cron.daily]#
[root@computer cron.daily]# ./00webalizer
Normal
[root@computer cron.daily]#
[root@computer cron.daily]#
[root@computer cron.daily]# cd
[root@computer ~]#
[root@computer ~]#
[root@computer ~]# cat 00webalizer
#! /bin/bash
# update access statistics for the web site
if [ -s /var/log/httpd/access_log ]; then
echo "Normal"
fi
#birchrock.org stats
if [ -s /var/log/httpd/birchrock.org-access_log ]; then
echo "BRC"
fi
[root@computer ~]#
[root@computer ~]#
[root@computer ~]# ./00webalizer
Normal
BRC
[root@computer ~]#
any thoughts as to what I'm doing wrong? As you can see from the version of 00webalizer that I copied to the root home directory, the second if statement is processed correctly when I remove the exec commands from the script. Admittedly, I'm no bash scripting guru so I have no idea what the problem can be. Thanks in advance.
|