ewiget
Admin
 Admin
| Posts: 171 |  | Karma: 2
|
backup mysql automatically using cron - 2006/12/16 15:32
You can automate mysql database backups using a cron job. It is very easy to do and you can schedule the backups as often as you like (we generally recommend a daily backup during a low peak time for your web site to reduce server load).
Here are the steps you need to take which are also listed in the file attached to this thread:
Basic Instruction Overview Download the backup script at the bottom of this message Extract the backup script using winzip or similar Open the mysqlbackup.sh file that is extracted in a text editor Set the variables in the file at the top for DBNAME, DBPASS, DBUSER Set your email address in the file for EMAIL Replace USERNAME with your cpanel login name in the file Create the /home/USERNAME/backup folder using ftp client on your account - this file is stored outside of your web root folder, which is /home/USERNAME/public_html and will not be reachable by any visitors Save this modified script Upload this script to the /home/USERNAME/etc folder using ftp client - make sure it is named exactly mysqlbackup.sh and not mysqlbackup.sh.txt Using your ftp client, chmod 755 /home/USERNAME/etc/mysqlbackup.sh login to cpanel and select Cron - this would be http://www.your_domain.com:2082 - replace your_domain with your actual domain name select Standard fill in the email information to mail cron job error messages enter the path for the cronjob to the file we uploaded above, i.e. /home/USERNAME/etc/mysqlbackup.sh select the times to run the backup, for instance to run every day at 3am just leave the default entries remember to download the backup mysql entries from the backup and then delete those entries from the folder or your web space will eventually exceed its limit.
Post edited by: ewiget, at: 2006/12/16 15:39
Ed Wiget Technical Support http://www.xtremewebhosts.com |