Forum Moderators: coopster

Message Too Old, No Replies

Backup mySQL database

using cron jobs

         

mn1dbp

6:03 pm on Jan 5, 2005 (gmt 0)

10+ Year Member



How does one go about using cron jobs to create a MySQL database dump each evening?

I have cPanel with my hosting and when i go to cron jobs i have a 'Command to run:' box

dreamcatcher

6:13 pm on Jan 5, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi,

What you will need to do is write some PHP code to perform your backup. Look into mysql_dump for this.

The command for the cron job would be something like this:

php -q /home/server/path/file.php

Note the spaces before and after -q.

You will also find information on cron jobs on the cpanel forum.

Good luck!

dc

sun818

6:20 pm on Jan 5, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



> about using cron jobs to create a MySQL database dump each evening?

Cron is the name of program that enables you to execute commands or scripts (groups of commands) automatically at a specified time/date.

Now, what you run in that cron job is up to you. Typically, I like to put a script in the cron job. Then if I need to edit the job, I just make changes to the script.

I see mySQL has a backup program called mysqldump [dev.mysql.com] and a Perl script for mySQL hot backups [dev.mysql.com]