############################################################################### # RW MySQL Dump 1.0.6 Readme file ############################################################################### # Copyright (c) 2001-2002 Right Web Developers. All rights reserved. # http://www.right-web.net/right-dev # mailto:developers@right-web.net ############################################################################### RW MySQL Dump ------------- Use this script to backup your MySQL databases, both structure and data. The script can be run from command prompt only. So, you can use crontab or other system scheduler to fully automate your data backup process. Features -------- - Windows and Linux support - MySQL Administration permissions not required - Third part software for interaction with MySQL not required - Works with any number of databases - Runs from command prompt only (for security reasons) - Supports compressing - Logs results into a log-file - Sends log-file by e-mail - Easy to install and use (3 required params only) System requirements ------------------- - Telnet or SSH access - Perl with DBD è DBI::MySQL - MySQL - sendmail (optional) - zip, pkzip or other compressor/decompressor (optional) - crontab or other system scheduler (optional) Configuration ------------- - Unzip rwmysqldump.pl from distributive to temporary dir and open for editing as plain text (for ex., Notepad for Windows or vi for Linux). - Check the first line #!/usr/bin/perl and correct if needed as your system Perl location. - Configure the parameters of script with your preferences. 1. BACKUP DIR - required This is an absolute or relative path to your folder where MySQL dumps will be stored. You must have read/write permissions on this folder. For example: $backup_path = "r:/temp/"; $backup_path = "../mysqlback/"; Names of dump files will be generated as shown below: dbname_yyyy-mm-dd_hh-mm-ss.sql, where dbname - database name yyyy-mm-dd - date of dump generating hh-mm-ss - time of dump generating 2. DATABASE NAMES - required The names of databases, which you want save. Enumerate all DB names in array. For example: #@databases = ('scalemod_scale','scalemod_rscale'); #@databases = ('rightwe_rightweb','rightwe_ckafans'); @databases = ('test'); 3. MYSQL ACCOUNT - required Your MySQL account info. This account will be used for access to databases to dump. The account must have read permissions for all databases which you plan to save. For example: $host = "localhost"; $port = "3306"; $user = "test"; $pass = "test"; 3. LOG FILE LOCATION - optional Absolute or relative path to log-file location include filename. Comment this variable if you don't need log-file output. For example: #$logfile = "/home/mysqlback/rwmysqldump.log"; #$logfile = "../mysqlback/rwmysqldump.txt"; $logfile = "r:/temp/rwmysqldump.txt"; You must have permissions to create and write this file. 4. ARCHIVER LOCATION - optional Absolute or relative path to archiver location include options. NOTE! At this time work with zip è pkzip only was tested. For example: $zip = "/usr/bin/zip -9mj "; Zip options are: 9 - compress better m - move files into arch (delete originals) j - junk paths (don't record paths to originals) See zip -h for more options Also add space to the end of line (next arg will be archive name) Comment this variable if you don't need compress dump files. Otherwise all dump files will be added to one archive. The archive name will be generated as shown below: dbuser_yyyy-mm-dd_hh-mm-ss.zip, where dbuser - database user yyyy-mm-dd - date of archiving hh-mm-ss - time of archiving 5. E-MAIL - optional e-mail address where log-file will be sent. Comment this variable if you don't need log-file mailing. For example: $recipient = 'webmaster@right-web.net'; If this option enable, log-file will be included into mail body. From field will looks as: @rwmysqldump Subject field will looks as: MySQL Dump from (yyyy-mm-dd_hh-mm-ss) 6. SENDMAIL LOCATION - required if log-file mailing option enabled For example: $mailprog = '/usr/sbin/sendmail'; - After all changes save the script file. Installation / Upgrade ---------------------- For upgrade from previous version of RW MySQL Dump just copy config variables from old version rwmysqldump.pl and paste into new version. Copy or upload file rwmysqldump.pl to your target dir on your system. NOTE! For security reasons we don't recommend placing the script under your public dir of your web site to exclude a chances of unauthorized access to the script. Run the script only under your SSH or Telnet account. The script must be CHMOD'ed to 755 or 777. Run --- You can run the script manually using Telnet or SSH access. Switch to dir where the script located and execute command perl rwmysqldump.pl You can use crontab or other system scheduler software to running rwmysqldump.pl automatically and periodically. Feedback -------- Please send bug reports, suggestions and any questions related to RW MySQL Dump to developers@right-web.net. Also you can fill-out our contact web-form located at - http://right-web.net/right-dev/rus/contacts.shtml Thank you for using our product! ------------------------------------------------ Right Web Developers http://right-web.net/right-dev/rus, a subsidiary of Right Web Network http://right-web.net/rus