gcloud compute execute command remotely

前端 未结 3 567
一生所求
一生所求 2021-02-01 16:21

Currently, if I want to execute something on a VM, I copy files over like this:

gcloud compute --project  copy-files --zone  /         


        
3条回答
  •  無奈伤痛
    2021-02-01 17:08

    A gcloud update that landed a week ago blocked passing ssh commands after '--' and effectively forces use of --command option for this. In this case use:

    gcloud compute ssh --zone ZONE INSTANCE --command 'cd /tmp && python some.py'.

提交回复
热议问题