Imported Upstream version 3.3.1
[debian/amanda] / perl / Amanda / Script_App.pm
index 2e6026185da7247892a7027cd70051fb738b66cd..aac85e6fe90203d300501bbfaa6172cb4dd79ff0 100644 (file)
@@ -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,8 +118,10 @@ 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 STDERR "$msg\n";