All pastes #79319 Raw Edit

Anonymous

public text v1 · immutable
·published 2006-07-05 06:12 UTC
rendered paste body

sub getstats
{
        my ($host) = @_;

        my $tmpdir = "/tmp/";
        my $domain = $host . ".foobar.com";
        my $asdir = "/var/lib/awstats/";
        my $asfile = "awstats$date.$domain.txt";
        my $astmp = $tmpdir . $asfile;
        my $awstats = $asdir . $asfile;

        system("rsync -av $host:$awstats $tmpdir");

        tie my @awstats, 'Tie::File', $astmp or die "Can't open $astmp: $!\n";

        for my $line ( @awstats )
        {
                if ( $line =~ /BEGIN_SIDER\s/ )
                {

                        splice @awstats, 0, ( $i + 1 );
                        last;
                }
                $i++;
        }

        untie @awstats;