Package CedarBackup2 :: Package extend :: Module split
[show private | hide private]
[frames | no frames]

Module CedarBackup2.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>

Classes
ByteQuantity Class representing a byte quantity.
LocalConfig Class representing this extension's configuration document.
SplitConfig Class representing split configuration.

Function Summary
  _splitDailyDir(dailyDir, sizeLimit, splitSize, backupUser, backupGroup)
Splits large files in a daily staging directory.
  _splitFile(sourcePath, splitSize, backupUser, backupGroup, removeSource)
Splits the source file into chunks of the indicated size.
  executeAction(configPath, options, config)
Executes the split backup action.

Variable Summary
Logger logger = <logging.Logger instance at 0x403fcd2c>
list SPLIT_COMMAND = ['split']
str SPLIT_INDICATOR = 'cback.split'
list VALID_BYTE_UNITS = [0, 1, 2, 4]

Function Details

_splitDailyDir(dailyDir, sizeLimit, splitSize, backupUser, backupGroup)

Splits large files in a daily staging directory.

Files that match INDICATOR_PATTERNS (i.e. "cback.store", "cback.stage", etc.) are assumed to be indicator files and are ignored. All other files are split.
Parameters:
dailyDir - Daily directory to encrypt
sizeLimit - Size limit, in bytes
splitSize - Split size, in bytes
backupUser - User that target files should be owned by
backupGroup - Group that target files should be owned by
Raises:
ValueError - If the encrypt mode is not supported.
ValueError - If the daily staging directory does not exist.

_splitFile(sourcePath, splitSize, backupUser, backupGroup, removeSource=False)

Splits the source file into chunks of the indicated size.

The split files will be owned by the indicated backup user and group. If removeSource is True, then the source file will be removed after it is successfully split.
Parameters:
sourcePath - Absolute path of the source file to split
splitSize - Encryption mode (only "gpg" is allowed)
backupUser - User that target files should be owned by
backupGroup - Group that target files should be owned by
removeSource - Indicates whether to remove the source file
Raises:
IOError - If there is a problem accessing, splitting or removing the source file.

executeAction(configPath, options, config)

Executes the split backup action.
Parameters:
configPath - Path to configuration file on disk.
           (type=String representing a path on disk.)
options - Program command-line options.
           (type=Options object.)
config - Program configuration.
           (type=Config object.)
Raises:
ValueError - Under many generic error conditions
IOError - If there are I/O problems reading or writing files

Variable Details

logger

Type:
Logger
Value:
<logging.Logger instance at 0x403fcd2c>                                

SPLIT_COMMAND

Type:
list
Value:
['split']                                                              

SPLIT_INDICATOR

Type:
str
Value:
'cback.split'                                                          

VALID_BYTE_UNITS

Type:
list
Value:
[0, 1, 2, 4]                                                           

Generated by Epydoc 2.1 on Thu Mar 29 20:58:31 2007 http://epydoc.sf.net