![]() |
| 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 |
||||||||||||
|
|
|||||||||||||
| Automatic Back-Up? /MySQL |
|
||
|


