From: Alexander Marx Date: Sun, 3 May 2015 03:24:39 +0000 (+0200) Subject: squid-accounting: fix monthly dbmove funktion to put values in history table X-Git-Tag: v2.17-core91~81^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a8e3b15d77512134c29d86ec0489d25f8a801fec;p=ipfire-2.x.git squid-accounting: fix monthly dbmove funktion to put values in history table --- diff --git a/src/squid-accounting/acct-lib.pl b/src/squid-accounting/acct-lib.pl index 779ecf8103..58b154a345 100644 --- a/src/squid-accounting/acct-lib.pl +++ b/src/squid-accounting/acct-lib.pl @@ -93,8 +93,10 @@ sub delbefore { } sub movedbdata { + &connectdb; $dbh->do("insert into ACCT_HIST select datetime(TIME_RUN,'unixepoch'),NAME,SUM(BYTES) from ACCT where datetime(TIME_RUN,'unixepoch') < datetime('now','start of month') group by NAME,datetime(TIME_RUN,'unixepoch');"); $dbh->do("DELETE FROM ACCT WHERE datetime(TIME_RUN,'unixepoch') < date('now','start of month');"); + &closedb; } sub gethourgraphdata {