dump remote mysql db via shell script

Hello all,

I’m busy with a script which backs up the FTP’s of a list of websites, but now I’ve come to the point where I need to get the mysql database contents as well. I know I can use phpmyadmin in a webbrowser to dump a remote database (download it), but was wondering if there was a way to do this with a “do shell script”, which just logs in, selects database(s), and pulls the sql data off the server in one go.

(I’ve been looking a bit into exporting it to the ftp periodically with cron, so it downloads with the regular backup, but due to the size of some of the db’s and not knowing much about how to tinker with cron on the servers we are using, this is not really an option and i’d be way better off doing it directly).

Many thanks for any pointers!