PDA

View Full Version : MySQL Backup?



Robert
June 1st, 2001, 05:15
Hello. =)

Does anyone know of a good, free script that will backup all my MySQL databases, zip them up (or tar them) and email them to me every night? The script would have to run on Cron so it can be ran automatically every night.

Any ideas would be great. Thanks.

atlas
June 2nd, 2001, 11:23
Just make a shell script that does exactly those things and put it in your cron file:



mysqldump -u <username> -p<password> <dbname> > <file>
tar -cf mysqlBackup<date>.tar <file>
mail <youremail> < mysqlBackup<date>.tar


(I suggest you use absolute pathnames to the files)

:)

-mk