X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=perl%2FAmanda%2FScript_App.pm;h=0b8c3f992875f8db344be241ad0b6200de847639;hb=cd0b924f27312d57bd42f6c4fae2b795139e2d0b;hp=3b6ff69a0e5d378728e26ee01753828720d4061f;hpb=fd48f3e498442f0cbff5f3606c7c403d0566150e;p=debian%2Famanda diff --git a/perl/Amanda/Script_App.pm b/perl/Amanda/Script_App.pm index 3b6ff69..0b8c3f9 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; @@ -116,11 +117,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 +183,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";