From 755b832851d918320e38145edea002bf36732f73 Mon Sep 17 00:00:00 2001 From: fermin831 Date: Fri, 21 Dec 2018 13:46:15 +0100 Subject: [PATCH] Accept module_crontab with whitespaces at the end of definition and be more verbose Former-commit-id: 55bd4acb8acf9c90eed3b1820c7cd8fb30328841 --- pandora_agents/unix/pandora_agent | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index a720cfde53..54376321ea 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -516,11 +516,18 @@ sub parse_conf_modules($) { log_message ('setup', "Invalid regular expression in intensive condition: $line"); } } - } elsif ($line =~ /^\s*module_crontab\s+(((\*|(\d+(-\d+){0,1}))\s*){5}).*$/) { + } elsif ($line =~ /^\s*module_crontab\s+(.*)$/) { my $cron_text = $1; chomp ($cron_text); + $cron_text =~ s/\s+$//; + # Get module name if is already read. + my $module_name_message = ""; + $module_name_message = " (module $module->{'name'})" if defined($module->{'name'}); if (cron_check_syntax($cron_text)) { $module->{'cron'} = $cron_text; + log_message('debug', "Cron '$module->{'cron'}' configured $module_name_message."); + } else { + log_message('setup', "Incorrect cron syntax '$cron_text'. This module$module_name_message will be executed always."); } } elsif ($line =~ /^\s*module_end\s*$/) {