LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 04-27-2010, 09:14 AM   #1
carlosinfl
Senior Member
 
Registered: May 2004
Location: Orlando, FL
Distribution: Arch
Posts: 2,905

Rep: Reputation: 77
MySQL Backup Recommendation


I have a MySQL server that has about 4 very important but relatively small (by today's standards) databases. They all run on CentOS 5 Linux and would like to know if anyone has a recommended simple script / procedure for doing a nightly or weekly backup on the 4 databases? I generally do a MySQL dump manually on Friday evening before I leave for the day and I realize there has to be a much better way to go about this from a professional stand point.

Here are the commands I run every week but would like to automate somehow and perhaps move to nightly:

Code:
mysqldump -u root -p mysql > mysql.sql
mysqldump -u root -p cal > mrbs.sql
mysqldump -u root -p webmail > webmail.sql
mysqldump -u root -p wiki > wiki.sql

Last edited by carlosinfl; 04-27-2010 at 09:15 AM.
 
Old 04-27-2010, 09:28 AM   #2
troop
Member
 
Registered: Feb 2010
Distribution: gentoo, arch, fedora, freebsd
Posts: 379

Rep: Reputation: 97
http://sourceforge.net/projects/automysqlbackup/
+ cron
e.g.
Code:
15 4  * * 6 /path/to/automysqlbackup.pl
 
Old 04-27-2010, 11:28 AM   #3
carlosinfl
Senior Member
 
Registered: May 2004
Location: Orlando, FL
Distribution: Arch
Posts: 2,905

Original Poster
Rep: Reputation: 77
Thank you very much. I will test the script and see how it works.
 
Old 04-27-2010, 08:02 PM   #4
choogendyk
Senior Member
 
Registered: Aug 2007
Location: Massachusetts, USA
Distribution: Solaris 9 & 10, Mac OS X, Ubuntu Server
Posts: 1,197

Rep: Reputation: 105Reputation: 105
Another possibility is ZRM for MySQL. You can also get that from sourceforge, MySQL.com, or Sun (now Oracle). Probably the easiest is to download the community edition from Zmanda (the first link above).

There are lots of howtos if you google zrm for mysql. I found an Ubuntu howto on howtoforge, and there's a quickstart on the Zmanda wiki.

(by the way, I like your owl sig. )
 
Old 04-29-2010, 07:51 AM   #5
carlosinfl
Senior Member
 
Registered: May 2004
Location: Orlando, FL
Distribution: Arch
Posts: 2,905

Original Poster
Rep: Reputation: 77
Thanks all. I downloaded the 1st suggested script and it worked perfectly however now I am a little nervous about having a MySQL root password in plain text right in the script configuration file. Should I create a generic user in MySQL just for backup roles and privileges? I don't know enough about GRANT OPTIONS or backups to know if I can create a dummy user and give him only what he requires to backup the databases safely or if this script requires the root or someone with GRANT ALL OPTIONS enabled.
 
Old 04-29-2010, 08:58 AM   #6
choogendyk
Senior Member
 
Registered: Aug 2007
Location: Massachusetts, USA
Distribution: Solaris 9 & 10, Mac OS X, Ubuntu Server
Posts: 1,197

Rep: Reputation: 105Reputation: 105
Here is an example of details for setting up a MySQL backup user from the ZRM for MySQL wiki -- http://wiki.zmanda.com/index.php/Pre...QL_Backup_User. That ought to be generic to whatever script you use for backup. This allows you to set it up so that backups are done with read only access, and recovery requires you to provide the password.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Recommendation for a backup utility? flycast Linux - Newbie 4 07-30-2006 09:36 PM
Recommendation for a backup utility? flycast Linux - Newbie 1 07-30-2006 02:50 PM
Backup software recommendation: what is best to do this??? cruiserparts Linux - Software 15 03-26-2006 10:48 PM
Backup Program Recommendation davcefai Linux - Software 4 10-19-2005 03:47 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 04:58 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration