X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=perl%2FAmanda%2FScript_App.pm;h=aac85e6fe90203d300501bbfaa6172cb4dd79ff0;hb=refs%2Ftags%2Fupstream%2F3.3.1;hp=3b6ff69a0e5d378728e26ee01753828720d4061f;hpb=fd48f3e498442f0cbff5f3606c7c403d0566150e;p=debian%2Famanda diff --git a/perl/Amanda/Script_App.pm b/perl/Amanda/Script_App.pm index 3b6ff69..aac85e6 100644 --- a/perl/Amanda/Script_App.pm +++ b/perl/Amanda/Script_App.pm @@ -23,6 +23,7 @@ no warnings; no strict; $GOOD = 0; $ERROR = 1; +$FAILURE = 2; use strict; use warnings; @@ -60,6 +61,7 @@ sub new { $execute_where = "client"; } Amanda::Util::setup_application($name, $execute_where, $CONTEXT_DAEMON); + debug("Arguments: " . join(' ', @ARGV)); #initialize config client to get values from amanda-client.conf config_init($CONFIG_INIT_CLIENT, undef); @@ -116,11 +118,13 @@ sub print_to_server { } elsif ($self->{action} eq "backup") { if ($status == $Amanda::Script_App::GOOD) { print {$self->{mesgout}} "| $msg\n"; - } else { + } elsif ($status == $Amanda::Script_App::ERROR) { print {$self->{mesgout}} "? $msg\n"; + } else { + print {$self->{mesgout}} "sendbackup: error $msg\n"; } } elsif ($self->{action} eq "restore") { - print STDOUT "$msg\n"; + print STDERR "$msg\n"; } elsif ($self->{action} eq "validate") { print STDERR "$msg\n"; } else { @@ -180,6 +184,10 @@ sub do { $self->{action} = 'validate'; } + if ($action eq 'backup') { + $self->_set_mesgout(); + } + # now convert it to a function name and see if it's # defined my $function_name = "command_$command";