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

[cobalt-users] Perl: modifying webalizer.pl script



I have a Raq4 server running the webalizer package for statistics. My logs
are all in the standard location.

I want my webalizer statistics to go into the webmaster's user directory
instead of in /home/sites/www.site.com/web/stats. My main reason for doing
this is so FrontPage doesn't try to synchronize the stats folder on sites
where the owner uses FrontPage.

All my webmaster accounts have a two-letter prefix followed by ".webmaster",
such as "fl.webmaster" or "ab.webmaster". So, I want the stats to go to
/home/sites/www.site.com/users/ab.webmaster/web. But, how do I update my
webalizer.pl script to put the files in this directory? I know I need to use
a regular expression similar to /webmaster$/, but I don't know enough (any)
perl to put it all together.

The script is webalizer.pl, inside the etc/cron.daily folder. Here's the
first part:

---
$prefix = "/home/sites";
my $messages;

chdir "$prefix" or die "Can't cd to $prefix??: $!\n";
opendir THEROOT, $prefix or die "Couldn't open $prefix?: $!\n";
@allsites = grep !/^\.\.?$/,  readdir THEROOT;

foreach $asite (@allsites)
{
  if (-l "$asite")
  {
    $webpath = "$prefix/$asite/web";
    $thepath = "$prefix/$asite/web/stats";
---

So, I just want to change $thepath to
"$prefix/$asite/users/*.webmaster/web", where * is any two-digit match. Any
perl people out there that can tell me how to do this? I know it's simple,
but my previous attemps were less than successful.

If I should provide any more information, please let me know. Thanks in
advance for any help!

-----------------------------------------
Marshall Janzen
Partner, Launch Design Group
http://www.launch.ca
(306) 569-0275 (Local)
(800) 811-8999 (Toll Free)
-----------------------------------------