Amanda::Cmdfile - manage Amanda cmdfile
use Amanda::Config qw( :getconf config_dir_relative );
use Amanda::Cmdfile;
my $conf_cmdfile = config_dir_relative(getconf($CNF_CMDFILE));
my $cmdfile = Amanda::Cmdfile->new($conf_cmdfile);
my $cmddata = Amanda::Cmdfile::Cmddata->new(
operation => $Amanda::Cmdfile::CMD_FLUSH,
config => get_config_name(),
holding_file => $hfile,
host => $hostname,
disk => $diskname,
dump_timestamp => $dump_timestamp,
storage => $storage_name,
working_pid => getpid(),
status => $Amanda::Cmdfile::CMD_TODO);
$cmdfile->add_to_memory($cmddata);
if ($cmdfile->has_holding($hfile)) { ... }
my $ids = $cmdfile->get_ids_for_holding($hfile);
$cmdfile->write();
Use these functions to read/update the cmdfile.
new
my $cmddata = Amanda::Cmdfile::new($conf_cmdfile)
Open a cmdfile, lock the file.
write
$cmddata->writenew();
Write the cmdfile. Unlock the file.
unlock
$cmddata->unlock();
Unlock the file.
add_to_memory
$cmddata->add_to_memory($cmddata);
Add Cmddata to the in memory copy.
add_to_file
$cmddata->add_to_file($cmddata);
Add the Cmddata to the file, write, unlock and close it.
has_holding
$has_holding = $cmddata->has_holding($holding_file);
Return true if there is a command for the holding file.
get_ids_for_holding
$ids = $cmddata->get_ids_for_holding($holding_file);
Return a string of all command ids for the holding file.
Use that function to create a Cmddata
new
my $cmddata = Amanda::Cmdfile::Cmddata->new(
operation => $Amanda::Cmdfile::CMD_FLUSH,
config => get_config_name(),
holding_file => $hfile,
host => $hostname,
disk => $diskname,
dump_timestamp => $dump_timestamp,
storage => $storage_name,
working_pid => getpid(),
status => $Amanda::Cmdfile::CMD_TODO);
Create a Cmddata
This page was automatically generated Tue Mar 19 07:08:15 2019 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.