![]() |
| Automatic Back-Up? /MySQL |
|
discogeek
|
Anyone know of a utility that would automatically back-up the MySQL databases on my dedicated server? I've been doing it by hand with phpAdmin whenever I remember...
|
||||||||||||
|
|
|||||||||||||
|
dbodner
|
You could setup a cron job that runs the following every day:
#!/bin/sh mysqldump -Q -u username -ppassword --all-databases > alldbbackup.sql That'll dump all databases in one .sql file, so it's not the easiest to restore (it's also not compressed, although I'm pretty sure that's an option in mysqldump, or you could just gzip the alldbbackup.sql). I wrote a quick and dirty script that does the job. It'll go through, dump all databases to their own .sql file, then tar and gzip them all up into one .tar.gz. So that this way you can easily extract the one .sql file to restore it.
*notes* $LOCALDIR is the directory the backups will be stored in (the final .tar.gz's) $DUMPDIR is the temporary directory the .sql files will be in. When the script is done, this will be empty. $USERCHMOD is the user that will own the backups when they've been completed. This user must exist on the system. If it's a cPanel system, you can likely keep the password blank. If it's a Plesk system, the root user should be changed to admin, and the password can be `cat /etc/psa/.psa.shadow` I'm not saying this is the best or only way to do it. This isn't a script I wrote to be mass-distributed and used on all systems. It's literally just something I wrote for my personal system |
||||||||||||||
|
|
|||||||||||||||
|
tedjtw
|
Try MySQLYOG, the commercial version. It is inexpensive. You can setup schedules on your local PC or server and have the backups run as needed. You can also have a separate file per database table. We use this with HMS for a client who requires a nightly backup to their own server.
HTH |
||||||||||||
|
|
|||||||||||||
|
gpok
|
Few more pieces of information that I got from HMS support crew:
-- As a shared server user you can also have cron jobs. -- Setting up cron jobs: http://www.webmasters-central.com/article-blog/tutorials/cron-tutorial-managing-cron-tab-or-cron-job-is-easy/ |
||||||||||||
|
|
|||||||||||||
|
whitesites
Forum Regular
|
MySQL Administrator. I have it run remote and local backs every night at 10 PM. In my opinion its the best tool for scheduled backups.
|
||||||||||||
|
|
|||||||||||||
| shared server? |
|
gpok
|
Thanks for the info! Is this available for shared hosting plans? I don't see it in my Control Panel and don't know if HMS would let me install it. Or do I need to have it installed on my own machine and have it connect to the DB? If so, where does the backup file get saved? ---- http://www.gracepok.com/ |
||||||||||||||
|
|
|||||||||||||||
|
whitesites
Forum Regular
|
YOu can download it at MySQL.com Its free.
you run it on your local machine, the backups will also be saved to your local machine. You don't need to install anything on the server. |
||||||||||||
|
|
|||||||||||||
|
nathacof
Forum Admin
|
I love the MySQL GUI Tools!
http://dev.mysql.com/downloads/ Here's an internal script we use for cron tasks:
You could save this as a text file, upload it to your server, and make it executable:
You can edit your crontab by logging into your web server using your customer account. Once logged in run:
Reference: http://linux.die.net/man/5/crontab |
||||||||||||||||||
|
|
|||||||||||||||||||
| Automatic Back-Up? /MySQL |
|
||
|


