Creating remote backups of MYSQL Database using rails

Hello All,

Can any body help me in writing a code for taking a mysql remote back
through rails code.Has any body worked on this

Thanks
Jagan

how about using cap:

http://source.mihelac.org/2007/1/15/backup-remote-database-with-capistrano
http://blog.caboo.se/articles/2006/12/28/a-better-capistrano-backup