#!/usr/bin/perl

$out = 0;
$in = 0;
$0 = "tailrsync:$out,$in";
open(FILE, "tail -f /var/log/rsyncd.log |");
while($linein = <FILE>) {
  if($linein =~ /wrote (\d+) bytes\s+read (\d+) bytes/) {
    $out += $1;
    $in += $2;
    if($out > 4294967296) { $out = $out - 4294967296; }
    if($in > 4294967296) { $in = $in - 4294967296; }
  }
  $0 = "tailrsync $out,$in";
}
close(FILE);

