You have several ways to do it,you can use shell script and run mysqldump
as cronjob,you should only write something like following script ,then add this to your crobjob.
#!/bin/bash
mysqldump --add-drop-table -h <hostname> -u <username> --password=<password> --all-databases > backup.sql
filename="backup.sql."`eval date +%Y%m%d`".tgz"
tar -czf $filename backup.sql
rm backup.sql
then edit crobjob by crontab -e
and add something like following line:
* * * * * /usr/local/bin/php /home/moein/projects/WebService/index.php
#this cronjob executed every min.
other way you can use event
in mysql to get backup.but your mysql version should be > 5.1.8
better description at mysql dev page.