/search.css" rel="stylesheet" type="text/css"/> /search.js">
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

Public Member Functions | Properties | Static Private Attributes
DybPython::dbcmd::MySQLDump Class Reference
Inheritance diagram for DybPython::dbcmd::MySQLDump:
Inheritance graph
Collaboration diagram for DybPython::dbcmd::MySQLDump:
Collaboration graph

List of all members.

Public Member Functions

def __call__
def __str__
def __call__


 exepath = property( _exepath )
 cmd = property( lambda self:self._cmd % self )
 cmd_nopw = property( lambda self:self._cmd % dict(self, password="***") )

Static Private Attributes

list _exenames = ['mysqldump','mysqldump5']
string _cmd = "time %(exepath)s --no-defaults --skip-opt --extended-insert --host=%(host)s --user=%(user)s --password=%(password)s %(database)s %(argline)s > %(path)s ; du -hs %(path)s "

Detailed Description

Wrapper around a mysqldump command line that integrates 
config parameters from the :file:`~/.my.cnf` with table list and
dumppath call arguments.
For background on mysqldump see http://dev.mysql.com/doc/refman/5.0/en/mysqldump.html

Options used with  the mysqldump command  includes `--no-defaults` which   
ensures the command is fully controlled by this script and does not depend on 
users defaults. Also the `--skip-opt` is used to avoid an error when used by 
with mysql identities without LOCK TABLES privilege::
    mysqldump: Got error: 1044: Access denied for user 'dayabay'@'%' to database 'offline_db' when doing LOCK TABLES

Definition at line 162 of file dbcmd.py.

Member Function Documentation

def DybPython::dbcmd::MySQLDump::__call__ (   self,
  verbose = True 
Arguments are used to update the tables list and dumppath 

Definition at line 181 of file dbcmd.py.

00182                                                         :
00183         """Arguments are used to update the tables list and dumppath """
00184         self['argline']=" ".join(tables)
00185         self['path']=dumppath
00186         return CommandLine.__call__(self, verbose=verbose)

def DybPython::dbcmd::CommandLine::__str__ (   self) [inherited]

Definition at line 30 of file dbcmd.py.

00031                      :
00032         return "%s %s " % (self.__class__.__name__, self.cmd_nopw )

def DybPython::dbcmd::CommandLine::__call__ (   self,
) [inherited]

Definition at line 33 of file dbcmd.py.

00034                              :
00035         verbose = kwa.pop('verbose', False)
00036         self.update(kwa)
00037         if verbose:
00038             log.info(self)
00039         else:
00040             log.debug(self)
00041         return os.popen(self.cmd).read()        

Member Data Documentation

list DybPython::dbcmd::MySQLDump::_exenames = ['mysqldump','mysqldump5'] [static, private]

Definition at line 178 of file dbcmd.py.

string DybPython::dbcmd::MySQLDump::_cmd = "time %(exepath)s --no-defaults --skip-opt --extended-insert --host=%(host)s --user=%(user)s --password=%(password)s %(database)s %(argline)s > %(path)s ; du -hs %(path)s " [static, private]

Definition at line 179 of file dbcmd.py.

Property Documentation

DybPython::dbcmd::CommandLine::exepath = property( _exepath ) [static, inherited]

Definition at line 18 of file dbcmd.py.

DybPython::dbcmd::CommandLine::cmd = property( lambda self:self._cmd % self ) [static, inherited]

Definition at line 19 of file dbcmd.py.

DybPython::dbcmd::CommandLine::cmd_nopw = property( lambda self:self._cmd % dict(self, password="***") ) [static, inherited]

Definition at line 20 of file dbcmd.py.

The documentation for this class was generated from the following file:
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Fri May 16 2014 09:55:40 for DybPython by doxygen 1.7.4