From d89cdc45e0323bc159a7c610733d5edd8d791e4c Mon Sep 17 00:00:00 2001 From: zarzuelo Date: Fri, 5 Nov 2010 13:38:56 +0000 Subject: [PATCH] 2010-11-05 Sergio Martin * util/pandora_sync_db.pl: Changed the tevento table synchronization to sync it only when the flag sync_data is 1 git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3541 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_server/ChangeLog | 6 ++++++ pandora_server/util/pandora_sync_db.pl | 17 +++++++++++------ 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/pandora_server/ChangeLog b/pandora_server/ChangeLog index 1559b5857d..84948e45b9 100644 --- a/pandora_server/ChangeLog +++ b/pandora_server/ChangeLog @@ -1,3 +1,9 @@ +2010-11-05 Sergio Martin + + * util/pandora_sync_db.pl: Changed the tevento table + synchronization to sync it only when the flag sync_data + is 1 + 2010-11-05 Sancho Lerena * Makefile.PL: Now default install for libs are the same than used in diff --git a/pandora_server/util/pandora_sync_db.pl b/pandora_server/util/pandora_sync_db.pl index 56b6bcc251..b9c16b549c 100755 --- a/pandora_server/util/pandora_sync_db.pl +++ b/pandora_server/util/pandora_sync_db.pl @@ -150,7 +150,7 @@ sub help_screen{ sub pandora_sync_main ($$$) { my ($dbh_source, $dbh_dest, $history_dbh) = @_; - + $|++; my $success = 0; my $percent; @@ -178,7 +178,9 @@ sub pandora_sync_main ($$$) { # Mixed cases empty_table($dbh_dest, 'tlayout_data'); - empty_table($dbh_dest, 'tevento'); + if($sync_data == 1) { + empty_table($dbh_dest, 'tevento'); + } print "\n\n"; @@ -190,10 +192,13 @@ sub pandora_sync_main ($$$) { @columns = ('id_agente_modulo', 'id_agent'); @types = ('module', 'agent'); enterprise_hook('sync_clone_table', [$dbh_source, $dbh_dest, 'tlayout_data', \@columns, \@types, @id_agent_comparation, @id_agentmodule_comparation, @id_server_export_comparation, @id_server_comparation]); - @columns = ('id_agentmodule', 'id_agente'); - @types = ('module', 'agent'); - enterprise_hook('sync_clone_table', [$dbh_source, $dbh_dest, 'tevento', \@columns, \@types, @id_agent_comparation, @id_agentmodule_comparation, @id_server_export_comparation, @id_server_comparation]); - + + if($sync_data == 1) { + @columns = ('id_agentmodule', 'id_agente'); + @types = ('module', 'agent'); + enterprise_hook('sync_clone_table', [$dbh_source, $dbh_dest, 'tevento', \@columns, \@types, @id_agent_comparation, @id_agentmodule_comparation, @id_server_export_comparation, @id_server_comparation]); + } + my $errors = $errors_agents + $errors_modules + $errors_servers + $errors_exportservers; if($errors == 0) {