【发布时间】:2017-12-04 03:05:31
【问题描述】:
我在 gcloud VM 实例上有一个 Python 脚本。我想通过这个 shell 脚本运行它:
gcloud compute instances start instance-1 #start instance
gcloud compute ssh my_username@instance-1 #ssh into it
cd project_folder #execute command once inside VM
python my_script.py #run python script
sudo shutdown now #exit instance
gcloud compute instances stop instance-1 #stop instance
前两个命令按预期工作;但是,其余命令不在 VM 上执行。连接虚拟机后如何制作执行命令的脚本?
【问题讨论】:
标签: linux bash shell google-cloud-platform gcloud