Web Hosting Talk







View Full Version : Anyone got a solid mysql database backup script??


Energizer Bunny
11-12-2006, 03:06 AM
Hello,
Does anyone have a nice sql database backup script which can backup all the sql database on the server to another location via ftp, and run daily and do backups on daily basis ?

If so please forward me to the right url/site etc.

Thanks

Jeremy
11-12-2006, 05:44 AM
http://bash.cyberciti.biz/backup/wizard-ftp-script.php

Just modify it to your needs ;)

Energizer Bunny
11-12-2006, 04:19 PM
Ahh thanks but its for a select day only say sunday or monday and so on "Select full backup day"

horizon
11-12-2006, 08:14 PM
With cPanel, you can set up a cron job for weekly backup operations if you'd like (either basic or advanced feature). ;)

Energizer Bunny
11-13-2006, 02:56 AM
Aah no i know about cpanel and whm feature about backups but i want DAILY mysql backup of all DB's on FTP remote location.

Cheers

horizon
11-13-2006, 07:08 AM
If you have access to a konsole, you can easily manipulate the server for setting up your own cron job with a linux command. ;)

Rob T
11-13-2006, 07:32 AM
http://sourceforge.net/projects/automysqlbackup/

I've used this in the past, it's a decent script. It will slow down your server considerably when it runs, however, so be sure you set your cron for a time when your server is least busy.

Energizer Bunny
11-14-2006, 12:32 AM
Hm rob why will it slow down server, would be backup up just database or the whole directory?

Uvex
11-14-2006, 06:37 PM
Aah no i know about cpanel and whm feature about backups but i want DAILY mysql backup of all DB's on FTP remote location.

Cheers
This is possible by CronJob in Cpanel. You can set it up to dump the database at a certain time on each day and then for it to put it in a certain FTP location. I know this because I do it myself. :)

layer0
11-14-2006, 11:07 PM
A simple solution would just be to make a tar.gz of /var/lib/mysql and scp it over on a nightly basis ... a simple bash script would do it :)

acidhoss
11-16-2006, 03:37 AM
what's wrong with phpMyAdmin? You can dump a script quite easily with that, and make back ups. CPanel has a nice feature for backing up files/databases as well.

Uvex
11-16-2006, 08:42 AM
what's wrong with phpMyAdmin? You can dump a script quite easily with that, and make back ups. CPanel has a nice feature for backing up files/databases as well.
phpMyAdmin wouldn't be up to the job imo, you would find that it would probably timeout if you had a large database. The best ways to do it and most efficient on the server (imo) is via Cron or as layer suggested.

grrrr
11-16-2006, 03:08 PM
This one works like a dream, I run it as a daily cronjob
http://www.restkultur.ch/personal/wolf/scripts/db_backup/

Even has FTP upload so you can offload your archives to another server; mediamax.com offers free online storage with FTP access, which I'd highly recommend. No good backing anything up to your live server as the day it gets rooted you can kiss it all goodbye.

foobic
11-16-2006, 08:42 PM
No good backing anything up to your live server as the day it gets rooted you can kiss it all goodbye.Good point, but here's the problem: if you use a script like this containing the ftp username and password of your remote backup, how safe is the backup when your live server gets rooted?

For my money the only safe option is to have the remote system log into your live server and retrieve the data. So, after using one of the methods above to create a dump file on the live server you'd use ftp, rsync or even wget (with apache authentication) to pull that over to the backup.

Another approach would be to allow direct access to mysql from the remote system. Then you could use mysqldump on the remote system and perhaps even use the mysql root password from there if you're confident it's secure enough.

valentin_nils
11-16-2006, 09:30 PM
Paidhosting,

1) Whats wrong with the tools provided by mysql itself ? Why dont you use them to backup databases ?
mysqldump, mysqlhotcopy etc.

2) Which MySQL version 3.x, 4.x , 5.x or even 5.1.x ?
3) Which database types (storage engine) are we actually talking about here ?

- Archive
- Berkeley DB
- Blackhole
- Cluster (NDB)
- CSV
- Falcon
- Isam
- MyISAM
- Merge
- InnoDB

Best regards