| Home | Trees | Index | Help |
|
|---|
| Package CedarBackup2 :: Package extend :: Module mysql |
|
Provides an extension to back up MySQL databases.
This is a Cedar Backup extension used to back up MySQL databases via the Cedar Backup command line. It requires a new configurations section <mysql> and is intended to be run either immediately before or immediately after the standard collect action. Aside from its own configuration, it requires the options and collect configuration sections in the standard Cedar Backup configuration file.
The backup is done via the mysqldump command included
with the MySQL product. Output can be compressed using gzip
or bzip2. Administrators can configure the extension either
to back up all databases or to back up only specific databases. The
extension assumes that all databases can be backed up by a single user
(typically "root").
Note that this code always produces a full backup. There is currently no facility for making incremental backups. If/when someone has a need for this and can describe how to do it, I'll update this extension or provide another.
You should always make /etc/cback.conf unreadble to
non-root users once you place mysql configuration into it, since mysql
configuration will contain information about available MySQL databases,
usernames and passwords.
ps) when the backup is
running. This is because none of the official MySQL backup scripts
provide a good way to specify password other than via the
--password command-line option. The only workaround I can
come up with would be to manipulate program I/O interactively through a
pipe, which is a real pain.
Author: Kenneth J. Pronovici <pronovic@ieee.org>
| Classes | |
|---|---|
LocalConfig |
Class representing this extension's configuration document. |
MysqlConfig |
Class representing MySQL configuration. |
| Function Summary | |
|---|---|
Backs up an individual MySQL database, or all databases. | |
Executes the MySQL backup action. | |
| Function Details |
|---|
backupDatabase(user, password, backupFile, database=None)Backs up an individual MySQL database, or all databases. This function backs up either a named local MySQL database or all local MySQL databases, using the passed in user and password for connectivity. This is always a full backup. There is no facility for incremental backups. The backup data will be written into the passed-in back file. Normally, this would be an object as returned fromopen(),
but it is possible to use something like a GzipFile to
write compressed output. The caller is responsible for closing the
passed-in backup file.
|
executeAction(configPath, options, config)Executes the MySQL backup action.
|
| Home | Trees | Index | Help |
|
|---|
| Generated by Epydoc 2.1 on Fri Apr 22 15:56:14 2005 | http://epydoc.sf.net |