mysqldump2email

Name

mysqldump2email - Dump MySQL data and send it to your mail server

mysqldump2email.zip

Synopsis

 % mysqldump2email
 % mysqldump2email --conf /path/to/config.yaml

Description

"mysqldump2email" is a command line application that dumps MySQL databases and zip the dump file, and then sends it to your mail server. It allows you to easily backup your MySQL databases into your mail spool, typically into your Google Mail spool.

You can run this via crontab, for example, everyday.

Requirement

This application requires perl 5.8.0 with following Perl modules installed on your box.

  • MIME::Lite
  • DateTime
  • YAML

Options

This application has a command-line option as follows:

--conf path/to/config.yaml
Specified the path to a configuration file. By default, "config.yaml" in the current directory.

Configuration

The distributions includes a sample configuration file "config.yaml.sample". You can rename it to "config.yaml" and configure "mysqldump2email".

  • mysqldump:
    • command: Set the full path of "mysqldump" command in your box.
    • username, password: Set your username and password for MySQL.
    • host (Optional): Set your hostname of MySQL server.
  • zip:
    • command: Set the full path of "zip" command in your box.
    • password (Optional): Set the password for encrypting/decrypting zip files. If not set, no encryption is performed.
  • mail:
    • from: Set email address for this application, which is used as "From" header.
    • to: Set the target email address, which is sent emails to.
    • route: Set how to send emails. Default is to use SMTP.
  • gspace:
  • tmpdir: Set the temporary directory for this application.
  • time_zone (Optional): Sets the timezone (e.g., Asia/Tokyo) for outgoing email "Date" header. Default is set to use local timezone of your box.

Changes

0.01 (2006-07-23 15:09:46 +0900)

  • Initial Release.

0.02 (2006-07-28 13:49:15 +0900)

Development

The development version is always available from the following:

/mysqldump2email/trunk

Any comments, suggestions, or patches are welcome (new ticket).

See Also

Author

Hirotaka Ogawa (hirotaka.ogawa at gmail.com)

This script is free software and licensed under the same terms as Perl (Artistic/GPL).