how to run process in background using gcloud ssh

3,196 views
Skip to first unread message

Shalabh Srivastava

unread,
Aug 7, 2018, 12:15:26 PM8/7/18
to gce-discussion

I have two gcp linux VMs, with that I am doing ssh from one instance to another and running process using below command, that works fine when command #1 is executed but when I  use option to run process in background command #2, the command shows no results.

  1. gcloud compute ssh -zone {Zone-Name} {vm1} -- 'cd /app/bin && ./clearcache && nohup ./startWeblogicAdmin >> admin.log' ==== This works fine
  2. gcloud compute ssh -zone {Zone-Name} {vm2} -- 'cd /app/bin && ./clearcache && nohup ./startWeblogicAdmin >> admin.log &' === This does not gets executed.
Need way to start process in background, event I log out of this ssh seesion from VM2

Fady (Google Cloud Platform)

unread,
Aug 7, 2018, 3:52:01 PM8/7/18
to gce-discussion

The gcloud ssh command worked fine for me, and I was able to ping Google in the background using the command below by following this Linux related stackoverflow thread.


gcloud compute ssh --zone=us-east1-c test --command="nohup ping -i 5 google.com > foo.out 2> foo.err < /dev/null &"


Since the question is more related to using Linux processes in the background, and for further help, I suggest posting your question at this Stackexchange site.


Reply all
Reply to author
Forward
0 new messages