I'm curious about how to best do backups of my MySQL database. I have read the backup sections of the O'Reilly mSQL/MySQL book and they recommend using mysqldump for full backups and the update log (using --log-update option).
What I want to do is schedule a bash script to run weekly to do a full backup using mysqldump but I want the script to keep three weeks worth before deleting a backup.
I then want to write another bash script that runs daily to copy the update log out to a backup directory and then purges the update log so it will only contain updates from the current day.
I'm guessing some of you are already doing this and I'm no bash script expert so if you have some code you'd be willing to share or a bash script reference website or book you can recommend that would be great. Also, if you have alternative backup strategies I'd be willing to consider those as well.