LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How would I create a cron job to backup all of my MySQL Databases and save to a file? (https://www.linuxquestions.org/questions/linux-newbie-8/how-would-i-create-a-cron-job-to-backup-all-of-my-mysql-databases-and-save-to-a-file-938333/)

iamtroberts 04-05-2012 01:04 PM

How would I create a cron job to backup all of my MySQL Databases and save to a file?
 
I am using Rhel 5.6, examples would be great, but a concise explanation of what the command is doing would be appreciated so I am not just copying something, I'm understanding and learning.

Thanks!

SAbhi 04-05-2012 01:43 PM

Quote:

Originally Posted by iamtroberts (Post 4645694)
I am using Rhel 5.6, examples would be great, but a concise explanation of what the command is doing would be appreciated so I am not just copying something, I'm understanding and learning.

Thanks!

so dat good u r doing....

u didnt specified your problem wat do u exactly want by this thread.

iamtroberts 04-10-2012 06:34 PM

Sorry about that, I posted the problem in the title not the body of the post. So here's my question: How would I create a cron job to backup all of my MySQL Databases and save to a file?

jschiwal 04-10-2012 07:12 PM

SAbhi. Please post in english and not text speak.

You can download the graphical MySQL management gui tool and schedule backup jobs. You can run it on a different computer that has a GUI. Either Linux or Windows.

The MySQL Administrator's Guide lists three methods for backups.
1) mysqldump --tab-/path/to/some/dir --opt db_name

2) mysqlhostcopy db_name /path/to/some/dir

3) Copying the *.frm, *MYD and *.MYI files (but not for InnoDB tables)

Consider buying the MySQL Administrator's Guide book. It lists other files you should backup in case of an emergency.
Also download the Manual from the website. It contains information about security that you must read.

The "man 5 crontab" man page contains an example crontab. This is the file read by cron that tells it what and when to run. For SE Linux, you will need to read Red Hats documentation. For MLS mode, you need to do more. The man 5 crontab manpage has a paragraph on SE Linux, including the commands, and a sample crontab.


All times are GMT -5. The time now is 11:06 PM.