View Single Post
Old 15-04-2008, 17:19   #17
The Jackal
Inactive
 
Join Date: Oct 2006
Posts: 1,604
The Jackal has a bronzed appealThe Jackal has a bronzed appeal
The Jackal has a bronzed appealThe Jackal has a bronzed appealThe Jackal has a bronzed appealThe Jackal has a bronzed appealThe Jackal has a bronzed appealThe Jackal has a bronzed appealThe Jackal has a bronzed appealThe Jackal has a bronzed appealThe Jackal has a bronzed appeal
Re: Virgin Media Capping bandwidth 24/7 ?

Well I'm just going to waste as much bandwidth as I possibly can and see what the graph looks like after a week.

Runs every minute as a cronjob.

cat waste_bandwidth.pl

#!/usr/bin/perl

use Net::SCP;
use Proc::Simple;

$lock='/tmp/important-process';

die("Already using bandwidth\n") if (-e "$lock");

$myproc = Proc::Simple->new();

$myproc->start(\&download);
sleep(61);
$myproc->poll() && $myproc->kill();

sub download {
$scp = Net::SCP->new( "static", "root" );
chdir(/tmp/);
while(1) {
$scp->get("/var/log/apache2/access_log") or die $scp->{errstr};
}
$scp->quit();
}
The Jackal is offline   Reply With Quote