Package Products :: Package ZenUtils :: Module ZenBackupBase :: Class ZenBackupBase
[hide private]
[frames] | no frames]

Class ZenBackupBase

source code

     object --+    
              |    
CmdBase.CmdBase --+
                  |
                 ZenBackupBase

Instance Methods [hide private]
 
__init__(self, noopts=0) source code
 
msg(self, msg)
If --verbose then send msg to stdout
source code
 
buildOptions(self)
Command-line options setup
source code
string
getPassArg(self, optname='dbpass')
Return string to be used as the -p (including the "-p") to MySQL commands.
source code
string
getTempDir(self)
Return directory to be used for temporary storage during backup or restore.
source code
 
runCommand(self, cmd=[], obfuscated_cmd=None)
Execute a command and return the results, displaying pre and post messages.
source code
boolean
runMysqlCmd(self, sql, switchDB=False)
Run a command that executes SQL statements in MySQL.
source code

Inherited from CmdBase.CmdBase: buildParser, checkLogpath, generate_configs, generate_xml_configs, generate_xml_table, getConfigFileDefaults, getGlobalConfigFileDefaults, getParamatersFromConfig, loadConfigFile, parseOptions, pretty_print_config_comment, setupLogging, validateConfigFile

Class Variables [hide private]
  doesLogging = False
Method Details [hide private]

__init__(self, noopts=0)
(Constructor)

source code 
Overrides: CmdBase.CmdBase.__init__

buildOptions(self)

source code 

Command-line options setup

Overrides: CmdBase.CmdBase.buildOptions

getPassArg(self, optname='dbpass')

source code 

Return string to be used as the -p (including the "-p") to MySQL commands.

Returns: string
password and flag

getTempDir(self)

source code 

Return directory to be used for temporary storage during backup or restore.

Returns: string
directory name

runCommand(self, cmd=[], obfuscated_cmd=None)

source code 

Execute a command and return the results, displaying pre and post messages.

Parameters:
  • cmd (list) - command to run
Returns:
results of the command (output, warnings, returncode)

runMysqlCmd(self, sql, switchDB=False)

source code 

Run a command that executes SQL statements in MySQL. Return true if the command was able to complete, otherwise (eg permissions or login error), return false.

Parameters:
  • sql (string) - an executable SQL statement
  • switchDB (boolean) - use -D options.dbname to switch to a database?
Returns: boolean
boolean