CedarBackup3.extend.split

Provides an extension to split up large files in staging directories.

When this extension is executed, it will look through the configured Cedar Backup staging directory for files exceeding a specified size limit, and split them down into smaller files using the ‘split’ utility. Any directory which has already been split (as indicated by the cback.split file) will be ignored.

This extension requires a new configuration section <split> and is intended to be run immediately after the standard stage action or immediately before the standard store action. Aside from its own configuration, it requires the options and staging configuration sections in the standard Cedar Backup configuration file.

author

Kenneth J. Pronovici <pronovic@ieee.org>

Module Contents

CedarBackup3.extend.split.logger
CedarBackup3.extend.split.SPLIT_COMMAND = ['split']
CedarBackup3.extend.split.SPLIT_INDICATOR = cback.split
class CedarBackup3.extend.split.SplitConfig(sizeLimit=None, splitSize=None)

Bases: object

Class representing split configuration.

Split configuration is used for splitting staging directories.

The following restrictions exist on data in this class:

  • The size limit must be a ByteQuantity

  • The split size must be a ByteQuantity

sizeLimit
splitSize
__repr__()

Official string representation for class instance.

__str__()

Informal string representation for class instance.

__eq__(other)

Equals operator, iplemented in terms of original Python 2 compare operator.

__lt__(other)

Less-than operator, iplemented in terms of original Python 2 compare operator.

__gt__(other)

Greater-than operator, iplemented in terms of original Python 2 compare operator.

__cmp__(other)

Original Python 2 comparison operator. Lists within this class are “unordered” for equality comparisons. :param other: Other object to compare to

Returns

-1/0/1 depending on whether self is <, = or > other

class CedarBackup3.extend.split.LocalConfig(xmlData=None, xmlPath=None, validate=True)

Bases: object

Class representing this extension’s configuration document.

This is not a general-purpose configuration object like the main Cedar Backup configuration object. Instead, it just knows how to parse and emit split-specific configuration values. Third parties who need to read and write configuration related to this extension should access it through the constructor, validate and addConfig methods.

Note: Lists within this class are “unordered” for equality comparisons.

split
__repr__()

Official string representation for class instance.

__str__()

Informal string representation for class instance.

__eq__(other)

Equals operator, iplemented in terms of original Python 2 compare operator.

__lt__(other)

Less-than operator, iplemented in terms of original Python 2 compare operator.

__gt__(other)

Greater-than operator, iplemented in terms of original Python 2 compare operator.

__cmp__(other)

Original Python 2 comparison operator. Lists within this class are “unordered” for equality comparisons. :param other: Other object to compare to

Returns

-1/0/1 depending on whether self is <, = or > other

validate()

Validates configuration represented by the object.

Split configuration must be filled in. Within that, both the size limit and split size must be filled in.

Raises

ValueError – If one of the validations fails

addConfig(xmlDom, parentNode)

Adds a <split> configuration section as the next child of a parent.

Third parties should use this function to write configuration related to this extension.

We add the following fields to the document:

sizeLimit      //cb_config/split/size_limit
splitSize      //cb_config/split/split_size
Parameters
  • xmlDom – DOM tree as from impl.createDocument()

  • parentNode – Parent that the section should be appended to

CedarBackup3.extend.split.executeAction(configPath, options, config)

Executes the split backup action.

Parameters
  • configPath (String representing a path on disk) – Path to configuration file on disk

  • options (Options object) – Program command-line options

  • config (Config object) – Program configuration

Raises
  • ValueError – Under many generic error conditions

  • IOError – If there are I/O problems reading or writing files