Código PHP:
$output=shell_exec("/usr/bin/mysqldump -u bd_user -pbd_pass --lock-tables my_database table_01 table_02 table_03 table_04");
if(trim($output)==NULL)
{
echo "There was an error while creating the backup";
exit();
}
$name="backup";
date_default_timezone_set("America/Caracas");
header('Content-type: text/plain');
header('Content-Disposition: attachment; filename="'.$name.'_'.date("d").'-'.date("m").'-'.date("Y").'_'.date("h").'-'.date("i").'-'.date("s").'_'.date("a").'.sql"');
echo $output;
exit();