All pastes #86966 Raw Edit

Unnamed

public text v1 · immutable
·published 2006-07-13 14:14 UTC
rendered paste body
#!/usr/bin/perl
use Logfile::Rotate;

my @sites = qw(cwr itiscom tl west amboise hawks seton onedope castle paitsio);

foreach my $site (@sites) {
        system('/usr/local/www/awstats/cgi-bin/awstats.pl', '-update', "-config=$site");
}

for (qw(world-access.log world-error.log
typo3ter-access.log typo3ter-error.log
itissupportuk-access.log itissupportuk-error.log
tl-access.log tl-error.log
westferrycouk-error.log westferry.co.uk-access.log
rjb-error.log rjb-access.log
jenglish-error.log jenglish-access.log
ivy-error.log ivy-access.log
hws-error.log hws-access.log
chdentistcom-error.log chdentistcom-access.log
biose-error.log biose-access.log
arouseme-error.log arouseme-access.log
ap-plumbing-error.log ap-plumbing-access.log
cwr-error.log cwr-access.log
castle-error.log castle-access.log
seton-error.log seton-access.log
onedope-error.log onedope-access.log
systemcms-access.log systemcms-error.log
roam-access.log roam-error.log
projectcms-access.log projectcms-error.log
onedope-access.log onedope-error.log
quovadis-access.log quovadis-error.log
hawkswood_shop-error.log hawkswood_shop-access.log
finnfur-error.log finnfur-access.log
fin-access.log fin-error.log
paitsio-error.log paitsio-access.log
httpd-error.log httpd-access.log
site-access.log site-error.log
test.rvantwisk.nl-access.log test.rvantwisk.nl-error.log
fsuk-access.log
))
    {
        my $log = new Logfile::Rotate( File   => "/var/log/apache/$_",
                Count  => 5,
                Gzip  => '/usr/bin/gzip',
                Dir    => '/data/apachelogs',
                Flock  => 'yes',
                Persist => 'yes',
                );

        # process log file
        $log->rotate();

}

qx(/usr/local/apache/bin/apachectl restart);