我的本地机器上有一个脚本,可以帮助我连接到我的ec2。但是,它不会运行指定的脚本文件。
awsconnect.sh:
ssh -i ".pemfile" ubuntu@"ec2-instance"
./data.sh
Run Code Online (Sandbox Code Playgroud)
data.sh是我在aws-ec2上的文件。
data.sh:
mkdir -p dumps/$(date +"%Y%m%d");
mysqldump -h localhost -port=3306 -u root -proot abc | gzip > dumps/$(date +"%Y%m%d")/abc.sql.gz;
logout
Run Code Online (Sandbox Code Playgroud)
My data.sh file is running fine if i run it from aws-ec2 command line.
But, it is not running from my script file.
What is the problem?