I have created a bash script for the automation of my database restore. When I run the following commands, I get /my/sql/file/path.sql: No such file or directory.
ssh $USER@"$cloneMysqlHost" gunzip /path/file.sql.gz && MySQL -u root -p db_name < /path/file.sql
I did an ls -lrot on the host I ssh to, just to make sure the file exists the permissions are correct, and they are.
Any ideas what I'm doing wrong?
Thanks in advance!
&&
and<
, which are probably not doing what you expect they are. Where exactly are the files in question (local and remote), and where is mysql supposed to be running?mysql
instead.