I make daily backups of the mysql database storing the contents of my onlinewebsite, and I would like to automate those half-dozen commands intoa single command.I tried a nave solution, by simply putting the list of commands intoa Bash script. This fails, as the script stops once it's entered theremote host.Any help appreciated.My failed (bash script) attempt :#! /bin/bash  echo Connecting to the remote host ...;  ssh -p myport myusername@myremotehost.net ;  echo Making the backup on the remote host ...;  mysqldump --databases --user=mysqluser --password=mypassword mydatabase > backup_copy.sql ;  echo Compressing the sql backup ...;  gzip backup_copy.sql;  echo Leaving the remote host ...;  exit;  echo Copying the backup from the remote host ...;  scp -P myport myusername@myremotehost.net:backup_copy.sql.gz /my/location/to/store/backups ;  echo Task finished;
Automate backup from remote mysql
bash;remote