Package CedarBackup2 :: Package actions :: Module stage
[show private | hide private]
[frames | no frames]

Module CedarBackup2.actions.stage

Implements the standard 'stage' action.

Author: Kenneth J. Pronovici <pronovic@ieee.org>

Function Summary
  executeStage(configPath, options, config)
Executes the stage backup action.
  _createStagingDirs(config, dailyDir, peers)
Creates staging directories as required.
  _getDailyDir(config)
Gets the daily staging directory.
  _getLocalPeers(config)
Return a list of LocalPeer objects based on configuration.
  _getRcpCommand(config, remotePeer)
Gets the RCP command associated with a remote peer.
  _getRemotePeers(config)
Return a list of RemotePeer objects based on configuration.
  _getRemoteUser(config, remotePeer)
Gets the remote user associated with a remote peer.

Variable Summary
Logger logger = <logging.Logger instance at 0x402e238c>

Function Details

executeStage(configPath, options, config)

Executes the stage 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 problems reading or writing files.

Notes:

  • The daily directory is derived once and then we stick with it, just in case a backup happens to span midnite.
  • As portions of the stage action is complete, we will write various indicator files so that it's obvious what actions have been completed. Each peer gets a stage indicator in its collect directory, and then the master gets a stage indicator in its daily staging directory. The store process uses the master's stage indicator to decide whether a directory is ready to be stored. Currently, nothing uses the indicator at each peer, and it exists for reference only.

_createStagingDirs(config, dailyDir, peers)

Creates staging directories as required.

The main staging directory is the passed in daily directory, something like staging/2002/05/23. Then, individual peers get their own directories, i.e. staging/2002/05/23/host.
Parameters:
config - Config object.
dailyDir - Daily staging directory.
peers - List of all configured peers.
Returns:
Dictionary mapping peer name to staging directory.

_getDailyDir(config)

Gets the daily staging directory.

This is just a directory in the form staging/YYYY/MM/DD, i.e. staging/2000/10/07, except it will be an absolute path based on config.stage.targetDir.
Parameters:
config - Config object
Returns:
Path of daily staging directory.

_getLocalPeers(config)

Return a list of LocalPeer objects based on configuration.
Parameters:
config - Config object.
Returns:
List of LocalPeer objects.

_getRcpCommand(config, remotePeer)

Gets the RCP command associated with a remote peer. Use peer's if possible, otherwise take from options section.
Parameters:
config - Config object.
remotePeer - Configuration-style remote peer object.
Returns:
RCP command associated with remote peer.

_getRemotePeers(config)

Return a list of RemotePeer objects based on configuration.
Parameters:
config - Config object.
Returns:
List of RemotePeer objects.

_getRemoteUser(config, remotePeer)

Gets the remote user associated with a remote peer. Use peer's if possible, otherwise take from options section.
Parameters:
config - Config object.
remotePeer - Configuration-style remote peer object.
Returns:
Name of remote user associated with remote peer.

Variable Details

logger

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

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