Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
Distribution: Solaris 9 & 10, Mac OS X, Ubuntu Server
Posts: 1,197
Rep:
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.
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.
Distribution: Solaris 9 & 10, Mac OS X, Ubuntu Server
Posts: 1,197
Rep:
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.