Home | Trees | Index | Help |
|
---|
Package CedarBackup2 :: Module peer :: Class RemotePeer |
|
object
--+
|
RemotePeer
Backup peer representing a remote peer in a backup pool.
This is a class representing a remote (networked) peer in a backup pool. Remote peers are backed up using an rcp-compatible copy command. A remote peer has associated with it a name (which must be a valid hostname), a collect directory, a working directory and a copy method (an rcp-compatible command).
You can also set an optional local user value. This username will be
used as the local user for any remote copies that are required. It can
only be used if the root user is executing the backup. The root user will
su
to the local user and execute the remote copies as that
user.
The copy method is associated with the peer and not with the actual request to copy, because we can envision that each remote host might have a different connect method.
The public methods other than the constructor are part of a "backup peer" interface shared with theLocalPeer
class.
Method Summary | |
---|---|
Initializes a remote backup peer. | |
Stages data from the peer into the indicated local target directory. | |
Checks the collect indicator in the peer's staging directory. | |
Writes the stage indicator in the peer's staging directory. | |
Returns the contents of a directory in terms of a Set. (Static method) | |
Copies files from the source directory to the target directory. (Static method) | |
Copies a remote source file to a target file. (Static method) | |
Copies a local source file to a remote host. (Static method) | |
Property target used to get the collect directory. | |
Property target used to get the local user. | |
Property target used to get the peer name. | |
Property target used to get the rcp command. | |
Property target used to get the remote user. | |
Property target used to get the working directory. | |
Property target used to set the collect directory. | |
Property target used to set the local user. | |
Property target used to set the peer name. | |
Property target to set the rcp command. | |
Property target used to set the remote user. | |
Property target used to set the working directory. | |
Inherited from object | |
x.__delattr__('name') <==> del x.name | |
x.__getattribute__('name') <==> x.name | |
x.__hash__() <==> hash(x) | |
T.__new__(S, ...) -> a new object with type S, a subtype of T | |
helper for pickle | |
helper for pickle | |
x.__repr__() <==> repr(x) | |
x.__setattr__('name', value) <==> x.name = value | |
x.__str__() <==> str(x) |
Property Summary | |
---|---|
name : Name of the peer (a valid DNS hostname). | |
collectDir : Path to the peer's collect directory (an absolute local path). | |
remoteUser : Name of the Cedar Backup user on the remote peer. | |
rcpCommand : An rcp-compatible copy command to use for copying files. | |
localUser : Name of the Cedar Backup user on the current host. | |
workingDir : Path to the peer's working directory (an absolute local path). |
Instance Method Details |
---|
__init__(self,
name,
collectDir,
workingDir,
remoteUser,
rcpCommand=None,
localUser=None)
Initializes a remote backup peer.
|
stagePeer(self, targetDir, ownership=None, permissions=None)Stages data from the peer into the indicated local target directory. The target directory must already exist before this method is called. If passed in, ownership and permissions will be applied to the files that are copied.
|
checkCollectIndicator(self, collectIndicator=None)Checks the collect indicator in the peer's staging directory. When a peer has completed collecting its backup files, it will write
an empty indicator file into its collect directory. This method checks
to see whether that indicator has been written. If the remote copy
command fails, we return
|
writeStageIndicator(self, stageIndicator=None)Writes the stage indicator in the peer's staging directory. When the master has completed collecting its backup files, it will write an empty indicator file into the peer's collect directory. The presence of this file implies that the staging process is complete. If you need to, you can override the name of the stage indicator file by passing in a different name.
|
_getCollectDir(self)Property target used to get the collect directory. |
_getLocalUser(self)Property target used to get the local user. |
_getName(self)Property target used to get the peer name. |
_getRcpCommand(self)Property target used to get the rcp command. |
_getRemoteUser(self)Property target used to get the remote user. |
_getWorkingDir(self)Property target used to get the working directory. |
_setCollectDir(self, value)Property target used to set the collect directory. The value must be an absolute path and cannot beNone . It does not have to
exist on disk at the time of assignment.
|
_setLocalUser(self, value)Property target used to set the local user. The value must be a non-empty string if it is notNone .
|
_setName(self, value)Property target used to set the peer name. The value must be a non-empty string and cannot beNone .
|
_setRcpCommand(self, value)Property target to set the rcp command. The value must be a non-empty string or None , even if we
translate that internally to DEF_RCP_COMMAND ). Internally,
we should always use self._rcpCommandList if we want the
actual command list.
|
_setRemoteUser(self, value)Property target used to set the remote user. The value must be a non-empty string and cannot beNone .
|
_setWorkingDir(self, value)Property target used to set the working directory. The value must be an absolute path and cannot beNone .
|
Static Method Details |
---|
_getDirContents(path)Returns the contents of a directory in terms of a Set. The directory's contents are read as aFilesystemList containing only files, and
then the list is converted into a sets.Set object for
later use.
|
_copyRemoteDir(remoteUser, localUser, remoteHost, rcpCommand, rcpCommandList, sourceDir, targetDir, ownership=None, permissions=None)Copies files from the source directory to the target directory. This function is not recursive. Only the files in the directory will be copied. Ownership and permissions will be left at their default values if new values are not specified. Behavior when copying soft links from the collect directory is dependent on the behavior of the specified rcp command.
|
_copyRemoteFile(remoteUser, localUser, remoteHost, rcpCommand, rcpCommandList, sourceFile, targetFile, ownership=None, permissions=None, overwrite=True)Copies a remote source file to a target file.
|
_pushLocalFile(remoteUser, localUser, remoteHost, rcpCommand, rcpCommandList, sourceFile, targetFile, overwrite=True)Copies a local source file to a remote host.
|
Property Details |
---|
nameName of the peer (a valid DNS hostname). |
collectDirPath to the peer's collect directory (an absolute local path).
|
remoteUserName of the Cedar Backup user on the remote peer.
|
rcpCommandAn rcp-compatible copy command to use for copying files.
|
localUserName of the Cedar Backup user on the current host.
|
workingDirPath to the peer's working directory (an absolute local path).
|
Home | Trees | Index | Help |
|
---|
Generated by Epydoc 2.1 on Thu Dec 22 20:45:14 2005 | http://epydoc.sf.net |