The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

BoxBackup::Config::DiskSets - Access to Box Backup diskset config files

SYNOPSIS

  use BoxBackup::Config::DiskSets;
  $diskSets = BoxBackup::Config::DiskSets->new();

or

  use BoxBackup::Config::DiskSets;
  $file = "/etc/bbox/raidfile.conf";
  $diskSets = BoxBackup::Config::DiskSets->new($file);

  @diskNames = $diskSets->getListofDisks();
  foreach $i (@diskNames)
  {
      print "Block size of " . $i . " is " . $disksets->getParamVal($i, "BlockSize) . " bytes.\n";
  }
  

ABSTRACT

BoxBackup::Config::DiskSets is a rather simple package that lets the user have access to the data from the disk set configuration file for Box Backup. It provides methods to retrieve the data only. No creation or editing is supported.

REQUIRES

Config::Scoped.

DESCRIPTION

Allows for programmatic access to the information stored in the Box Backup 'disk set' config file, which holds the information related to each disk set in the Box Backup installation.

Methods

  • new(). The new() method parses the disksets file given as the first (and only) parameter, or, if no parameter is given, parses /etc/box/raidfile.conf, and creates the object.

  • getListofDisks(). The getListofDisks() method returns an array of the names of all the disk sets found in the config file.

  • getParamVal(). The getParamVal() method returns the value of a paramter for a given disk. 2 paramters are passed to this method

    • disk. This diskset for which the parameter should be retrieved. Normally 'disc0' or 'disc1', although anything is possible. Use getListofDisks() to retrieve the names from the file.

    • parameter. The parameter you wish to retrieve from the config file, for a given disk (see above). Currently, the following parameters are available in the file:

      - SetNumber. This is the disk set number, that's used in the accounts config file.
      - BlockSize. The size of the data blocks used on this diskset. Measured in bytes.
      - Dir0. The first of the RAID drives.
      - Dir1. The second RAID drive.
      - Dir2. The third RAID drive.

AUTHOR

Per Reedtz Thomsen (mailto:pthomsen@reedtz.com)