Home | Trees | Index | Help |
|
---|
Package CedarBackup2 :: Module peer :: Class LocalPeer |
|
object
--+
|
LocalPeer
Backup peer representing a local peer in a backup pool.
This is a class representing a local (non-network) peer in a backup pool. Local peers are backed up by simple filesystem copy operations. A local peer has associated with it a name (typically, but not necessarily, a hostname) and a collect directory.
The public methods other than the constructor are part of a "backup peer" interface shared with theRemotePeer
class.
Method Summary | |
---|---|
Initializes a local 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. | |
Copies files from the source directory to the target directory. (Static method) | |
Copies a source file to a target file. (Static method) | |
Property target used to get the collect directory. | |
Property target used to get the peer name. | |
Property target used to set the collect directory. | |
Property target used to set the peer name. | |
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. | |
collectDir : Path to the peer's collect directory (an absolute local path). |
Instance Method Details |
---|
__init__(self,
name,
collectDir)
|
stagePeer(self, targetDir, ownership=None, permissions=None)Stages data from the peer into the indicated local target directory. The collect and target directories must both 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. We're
"stupid" here - if the collect directory doesn't exist,
you'll naturally get back
|
writeStageIndicator(self, stageIndicator=None, ownership=None, permissions=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. |
_getName(self)Property target used to get the peer name. |
_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.
|
_setName(self, value)Property target used to set the peer name. The value must be a non-empty string and cannot beNone .
|
Static Method Details |
---|
_copyLocalDir(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. The source and target directories are allowed to be soft links to a directory, but besides that soft links are ignored.
|
_copyLocalFile(sourceFile=None, targetFile=None, ownership=None, permissions=None, overwrite=True)Copies a source file to a target file. If the source file isNone then the target file will be
created or overwritten as an empty file. If the target file is
None , this method is a no-op. Attempting to copy a soft
link or a directory will result in an exception.
|
Property Details |
---|
nameName of the peer. |
collectDirPath to the peer's collect directory (an absolute local path).
|
Home | Trees | Index | Help |
|
---|
Generated by Epydoc 2.1 on Thu Dec 22 20:45:16 2005 | http://epydoc.sf.net |