# vim:ft=perl
-# Copyright (c) 2008,2009 Zmanda, Inc. All Rights Reserved.
+# Copyright (c) 2008-2012 Zmanda, Inc. All Rights Reserved.
#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 as published
-# by the Free Software Foundation.
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
no strict;
$GOOD = 0;
$ERROR = 1;
+$FAILURE = 2;
use strict;
use warnings;
$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);
} 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 {
$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";