I'm using a shell script that opens a ssh connection and creates an sqldump.
But, when I use mysqldump
in the shell script it gives me the error:
"No such file or directory"
This is the line I use:
ssh user@host mysqldump -uusername -hlocalhost -ppassword --all-databases > /home/user/sqlfile.sql
The mysqldump
works when i use it in an opened ssh connection or at the server in the commandline.
So my question is why do I get the error and why can't I run the mysqldump command in a shell script?