X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Fsquid-accounting%2Facct.pl;h=e90d06ed385d04c8af948a90b09f763c5f54d0a2;hb=d38f3eed08d71343cc16de61373860e5aa7efcfd;hp=68eb63c75e309102702f48ec7d10d93ed496b175;hpb=b1881251d6cdd92c7e887813395386afe9692944;p=ipfire-2.x.git diff --git a/src/squid-accounting/acct.pl b/src/squid-accounting/acct.pl index 68eb63c75e..e90d06ed38 100755 --- a/src/squid-accounting/acct.pl +++ b/src/squid-accounting/acct.pl @@ -100,7 +100,7 @@ if (-f $proxyenabled && $proxylog eq $Lang::tr{'running'}){ $dbh=&ACCT::connectdb; my $m=sprintf("%d",(localtime((time-3600)))[4]+1); &ACCT::logger($settings{'LOG'},"month before one hour $m, now is ".($mon+1)."\n"); - if ($m = ($mon+1) || $m == '12' && ($mon+1) == '1'){ + if ($m < ($mon+1) || $m == '12' && ($mon+1) == '1'){ #Logrotate my $year1=$year+1900; system ("tar", "cfz", "/var/log/accounting-$m-$year1.tar.gz", "/var/log/accounting.log"); @@ -217,6 +217,7 @@ sub fill_db{ my $tim=time(); #Fill ACCT table with accounting information foreach my $name (sort keys %counter){ + next if (substr($name,-1,1) eq '$'); foreach my $bytes (keys %{ $counter{$name} }) { $dbh->do("insert into ACCT (TIME_RUN,NAME,BYTES) values ('$tim','$name','$counter{$name}{$bytes}');"); }