Keyword: mysql. If your primary concern is backing up your MySQL databases, then ChrisM01 already gave you a link to the Backup and Recovery documentation at mysql.org, and Chaitanya already gave you a reference to phpMyBackupPro. I would also look at Zmanda Recovery Manager (ZRM) for MySQL
. Both of those are open source. You can install them on your system and configure them to back up your MySQL databases according to your own choice of schedule.
You should also have a regular backup routine aside from MySQL. If you use ZRM, that will end up with disk based files that you could use to recover your databases. You can then use something like Amanda
(already mentioned by ChrisM01) to back that up along with the rest of your system -- to tape, to virtual tapes, to off site systems (cloud backup), etc.
You can play with scripting these sorts of things yourself, and that can be a good learning process, but you will quickly grow out of that. There are just lots of open source projects out there that will do these things for you. They will take into account a lot more detail than you can manage to script for yourself.