Amanda::Device - interact with Amanda data-storage devices
use Amanda::Device qw( :constants );
my $dev = Amanda::Device->new($device_name); if ($dev->read_label() == $DEVICE_STATUS_SUCCESS) { print "Label on $device_name is '$dev->volume_label'\n"; } See http://wiki.zmanda.com/index.php/Device_API for details on how Devices are used.
Stable
See the wiki for descriptions of these functions. Note that C instance variables are represented by accessor functions of the same name.
configure($use_global_config)
read_label()
start($mode, $label, $timestamp)
finish()
start_file($jobinfo)
where $jobinfo
is a dumpfile_t
(see the Amanda::Types manpage)
write_block($size, $data, $short_block)
Note that Perl code is not expected to handle on-device data, so there is currently no way to provide data to this function from Perl. This may change in future revisions.
write_from_fd($queue_fd)
where $fd
is an integer file descriptor, not a filehandle
finish_file()
seek_file($file)
seek_block($block)
read_block($size)
read_to_fd($queue_fd)
where $fd
is an integer file descriptor, not a filehandle
Note that Perl code is not expected to handle on-device data, so there is currently no way to access the data this function returns. This may change in future revisions.
property_list()
returns a list of properties, each represented as a hash:
{ 'access' => $access_flags, 'name' => $property_name, 'description' => $property_description }
property_get($property_name)
returns the property, with the appropriate Perl type, or undef. In array
context, returns the list ($value, $surety, $source)
.
property_set($property_name, $value)
property_set_ex($property_name, $value, $surety, $source)
where $value
is of an appropriate type for the given property, $surety
is
a $PROPERTY_SURETY_*
constant, and $source
is a $PROPERTY_SOURCE_*
constant.
recycle_file($filenum)
file()
(accessor function)
block()
(accessor function)
in_file()
(accessor function)
device_name()
(accessor function)
access_mode()
(accessor function)
is_eof()
(accessor function)
volume_label()
(accessor function)
volume_time()
(accessor function)
min_block_size()
(accessor function)
max_block_size()
(accessor function)
block_size()
(accessor function)
volume_header()
(accessor function)
This module defines a large number of constants. Again, consult the
wiki or device.h
for the details on their meaning. These constants
are available from the package namespace (e.g.,
Amanda::Device::ACCESS_WRITE
), or imported with the :constant
import tag.
This page was automatically generated Fri Feb 5 19:41:21 2010 from the Amanda source tree, and documents the most recent development version of Amanda. For documentation specific to the version of Amanda on your system, use the 'perldoc' command.