Imported Upstream version 3.3.0
[debian/amanda] / perl / Amanda / Script_App.pm
index 3b6ff69a0e5d378728e26ee01753828720d4061f..0b8c3f992875f8db344be241ad0b6200de847639 100644 (file)
@@ -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";