use Amanda::Config qw( :init :getconf config_dir_relative );
use Amanda::Debug qw( :logging );
use Amanda::Paths;
-use Amanda::Util qw( :constants );
+use Amanda::Util qw( :constants quote_string );
sub new {
my $class = shift;
- my ($config, $host, $disk, $device, $level, $index, $message, $collection, $record, $exclude_list, $exclude_optional, $include_list, $include_optional, $bsize, $ext_attrib, $ext_header, $ignore, $normal, $strange, $error_exp, $directory) = @_;
+ my ($config, $host, $disk, $device, $level, $index, $message, $collection, $record, $exclude_list, $exclude_optional, $include_list, $include_optional, $bsize, $ext_attrib, $ext_header, $ignore, $normal, $strange, $error_exp, $directory, $suntar_path) = @_;
my $self = $class->SUPER::new($config);
- $self->{suntar} = "/usr/sbin/tar";
+ $self->{suntar} = $Amanda::Constants::SUNTAR;
+ if (defined $suntar_path) {
+ $self->{suntar} = $suntar_path;
+ }
$self->{pfexec} = "/usr/bin/pfexec";
$self->{gnutar} = $Amanda::Constants::GNUTAR;
$self->{teecount} = $Amanda::Paths::amlibexecdir."/teecount";
sub command_selfcheck {
my $self = shift;
+ $self->print_to_server("disk " . quote_string($self->{disk}));
+
+ $self->print_to_server("amsuntar version " . $Amanda::Constants::VERSION,
+ $Amanda::Script_App::GOOD);
+
if (!-e $self->{suntar}) {
$self->print_to_server_and_die(
"application binary $self->{suntar} doesn't exist",
if (!defined $self->{disk} || !defined $self->{device}) {
return;
}
- print "OK " . $self->{disk} . "\n";
print "OK " . $self->{device} . "\n";
print "OK " . $self->{directory} . "\n" if defined $self->{directory};
$self->validate_inexclude();
my @opt_error;
my $opt_lang;
my $opt_directory;
+my $opt_suntar_path;
Getopt::Long::Configure(qw{bundling});
GetOptions(
'error=s' => \@opt_error,
'lang=s' => \$opt_lang,
'directory=s' => \$opt_directory,
+ 'suntar-path=s' => \$opt_suntar_path,
) or usage();
if (defined $opt_lang) {
$ENV{LANG} = $opt_lang;
}
-my $application = Amanda::Application::Amsuntar->new($opt_config, $opt_host, $opt_disk, $opt_device, $opt_level, $opt_index, $opt_message, $opt_collection, $opt_record, \@opt_exclude_list, $opt_exclude_optional, \@opt_include_list, $opt_include_optional,$opt_bsize,$opt_ext_attrib,$opt_ext_head, \@opt_ignore, \@opt_normal, \@opt_strange, \@opt_error, $opt_directory);
+my $application = Amanda::Application::Amsuntar->new($opt_config, $opt_host, $opt_disk, $opt_device, $opt_level, $opt_index, $opt_message, $opt_collection, $opt_record, \@opt_exclude_list, $opt_exclude_optional, \@opt_include_list, $opt_include_optional,$opt_bsize,$opt_ext_attrib,$opt_ext_head, \@opt_ignore, \@opt_normal, \@opt_strange, \@opt_error, $opt_directory, $opt_suntar_path);
$application->do($ARGV[0]);