[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cobalt-users] Custom Webalizer.conf file



"Ian" <ian@xxxxxxxxxxxxxxxxxxxx> wrote:
> Thanks for that Steve,
>
> I want it to run itself using cron each night as it does currently...
>
> As I understand it I need to create .conf files for each virtual site and
> place these somewhere and do something so that it gets used each night

Exactly.  I'll assume you know how to create a cron entry using either
"crontab" or by adding a script to /etc/cron.daily.  If not, this is pretty
basic *nix stuff and you should probably either search the archives or use
google to find a cron tutorial.  google is your friend.

> but where and how is my problem lol

I just wrote the script below in about 30 seconds.  It will get you started.
It loops through all of your sites, goes to the parent directory of each
site and runs webalizer, repeating for each site.  Webalizer will expect a
webalizer.conf file in each site's parent directory and if not found will
use /etc/webalizer.conf.

#!/bin/sh
for SITE in `ls -1 /home/sites/ | grep -v site | grep -v home`
do
cd /home/sites/$SITE/
webalizer <flags here>
done

You may want to test each of the parts from the commandline to get familiar
with what they do and replace the webalizer line with something like:

echo "looping - $SITE" (without the comments) to see what's happening before
running it.

--
Steve Werby
President, Befriend Internet Services LLC
http://www.befriend.com/