awstats dir process
jmeno souboru → /etc/awstats/awstats.domena.cz.conf
#!/usr/bin/perl
# (c) sh@isecure.cz 2007
use strict;
use constant CONFDIR => "/etc/awstats/";
use constant AWSBIN => "/usr/local/awstats/wwwroot/cgi-bin/awstats.pl ";
use constant ARGS => "-update -config=";
############################################################################
opendir(DIRHANDLE, CONFDIR) || die "Cannot opendir ".CONFDIR.": $!";
my $name = '';
foreach $name (sort readdir(DIRHANDLE)) {
if($name =~ /^awstats\./) {
#############################################
if($name =~ /^awstats\.(.*)\.conf$/) {
print "--------------------------------------------\nfound file -> generating stats: $name - $1\n";
system(AWSBIN.ARGS.$1);
}
#############################################
}
}
closedir(DIRHANDLE);
Tagy:
perl 30 řádků | 2008-02-04 21:10:50 | air.kadlec@seznam.cz