From badf6edd94395c8bae4f361151b079e23f3518b6 Mon Sep 17 00:00:00 2001 From: hkosaka Date: Wed, 26 Sep 2012 11:35:33 +0000 Subject: [PATCH] 2012-09-26 Hirofumi Kosaka * util/pandora_db.pl: bug fix: 'audit_purge' was used to purge tagente_datos_string (instead of 'string_purge'). Also fixed the bug that the oldest data on the corresponding table would be never purged. Merged from 4.0 branch. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7001 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_server/ChangeLog | 9 +++++++++ pandora_server/util/pandora_db.pl | 10 +++++----- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/pandora_server/ChangeLog b/pandora_server/ChangeLog index 0238210bae..0bab3b1581 100644 --- a/pandora_server/ChangeLog +++ b/pandora_server/ChangeLog @@ -1,3 +1,12 @@ +2012-09-26 Hirofumi Kosaka + + * util/pandora_db.pl: bug fix: 'audit_purge' was used to purge + tagente_datos_string (instead of 'string_purge'). Also fixed + the bug that the oldest data on the corresponding table would + be never purged. + + Merged from 4.0 branch. + 2012-09-25 Vanessa Gil * util/tool_api.pl: Added file to create events using API. diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 9e299a852b..1b4c9338e6 100755 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -102,7 +102,7 @@ sub pandora_purgedb ($$) { $purge_steps = int($total_time / $BIG_OPERATION_STEP); for (my $ax = 1; $ax <= $BIG_OPERATION_STEP; $ax++){ - db_do ($dbh, "DELETE FROM tagente_datos WHERE utimestamp < ". ($first_mark + ($purge_steps * $ax)) . " AND utimestamp > ". $first_mark ); + db_do ($dbh, "DELETE FROM tagente_datos WHERE utimestamp < ". ($first_mark + ($purge_steps * $ax)) . " AND utimestamp >= ". $first_mark ); print "[PURGE] Data deletion Progress %$ax .. \r"; } print "\n"; @@ -119,7 +119,7 @@ sub pandora_purgedb ($$) { $purge_steps = int($total_time / $BIG_OPERATION_STEP); for (my $ax = 1; $ax <= $BIG_OPERATION_STEP; $ax++){ - db_do ($dbh, "DELETE FROM tagente_datos_log4x WHERE utimestamp < ". ($first_mark + ($purge_steps * $ax)) . " AND utimestamp > ". $first_mark ); + db_do ($dbh, "DELETE FROM tagente_datos_log4x WHERE utimestamp < ". ($first_mark + ($purge_steps * $ax)) . " AND utimestamp >= ". $first_mark ); print "[PURGE] Log4x data deletion progress %$ax .. \r"; } print "\n"; @@ -140,7 +140,7 @@ sub pandora_purgedb ($$) { $purge_steps = int($total_time / $BIG_OPERATION_STEP); for (my $ax = 1; $ax <= $BIG_OPERATION_STEP; $ax++){ - db_do ($dbh, "DELETE FROM tagente_datos_string WHERE utimestamp < ". ($first_mark + ($purge_steps * $ax)) . " AND utimestamp > ". $first_mark ); + db_do ($dbh, "DELETE FROM tagente_datos_string WHERE utimestamp < ". ($first_mark + ($purge_steps * $ax)) . " AND utimestamp >= ". $first_mark ); print "[PURGE] String deletion Progress %$ax .. \r"; } print "\n"; @@ -225,7 +225,7 @@ sub pandora_purgedb ($$) { $purge_steps = int( $total_time / $BIG_OPERATION_STEP); for (my $ax = 1; $ax <= $BIG_OPERATION_STEP; $ax++){ - db_do ($dbh, "DELETE FROM tagent_access WHERE utimestamp < ". ( $first_mark + ($purge_steps * $ax)) . " AND utimestamp > ". $first_mark); + db_do ($dbh, "DELETE FROM tagent_access WHERE utimestamp < ". ( $first_mark + ($purge_steps * $ax)) . " AND utimestamp >= ". $first_mark); print "[PURGE] Agent access deletion progress %$ax .. \r"; } print "\n"; @@ -386,7 +386,7 @@ sub pandora_load_config ($) { $conf->{'_event_purge'} = get_db_value ($dbh, "SELECT value FROM tconfig WHERE token = 'event_purge'"); $conf->{'_trap_purge'} = get_db_value ($dbh, "SELECT value FROM tconfig WHERE token = 'trap_purge'"); $conf->{'_audit_purge'} = get_db_value ($dbh, "SELECT value FROM tconfig WHERE token = 'audit_purge'"); - $conf->{'_string_purge'} = get_db_value ($dbh, "SELECT value FROM tconfig WHERE token = 'audit_purge'"); + $conf->{'_string_purge'} = get_db_value ($dbh, "SELECT value FROM tconfig WHERE token = 'string_purge'"); $conf->{'_gis_purge'} = get_db_value ($dbh, "SELECT value FROM tconfig WHERE token = 'gis_purge'"); $conf->{'_days_purge'} = get_db_value ($dbh, "SELECT value FROM tconfig WHERE token = 'days_purge'");