How to run process in background using gcloud ssh
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
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.
gcloud compute ssh -zone Zone-Name vm1 -- 'cd /app/bin && ./clearcache && nohup ./startWeblogicAdmin >> admin.log' ==== This works fine
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
ssh
add a comment |Â
up vote
0
down vote
favorite
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.
gcloud compute ssh -zone Zone-Name vm1 -- 'cd /app/bin && ./clearcache && nohup ./startWeblogicAdmin >> admin.log' ==== This works fine
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
ssh
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
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.
gcloud compute ssh -zone Zone-Name vm1 -- 'cd /app/bin && ./clearcache && nohup ./startWeblogicAdmin >> admin.log' ==== This works fine
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
ssh
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.
gcloud compute ssh -zone Zone-Name vm1 -- 'cd /app/bin && ./clearcache && nohup ./startWeblogicAdmin >> admin.log' ==== This works fine
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
ssh
ssh
edited Aug 8 at 7:10
Jaroslav Kucera
4,3904621
4,3904621
asked Aug 8 at 6:17
user126930
1
1
add a comment |Â
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
0
down vote
Having no idea of gcp linux, I suppose, the second example doesn't work because "&" is used by the shell to run commands in background. But ssh doesn't start any shell when you specify a command, it just runs the command, then exits.
So, if my assumption is right, you need to login to the remote system and execute commands using expect-like chat-language or try sending the whole command to background on your local system. Something like that:
nohup gcloud compute ssh -zone Zone-Name vm2 -- 'cd /app/bin && ./clearcache && nohup ./startWeblogicAdmin >> admin.log' &
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
Having no idea of gcp linux, I suppose, the second example doesn't work because "&" is used by the shell to run commands in background. But ssh doesn't start any shell when you specify a command, it just runs the command, then exits.
So, if my assumption is right, you need to login to the remote system and execute commands using expect-like chat-language or try sending the whole command to background on your local system. Something like that:
nohup gcloud compute ssh -zone Zone-Name vm2 -- 'cd /app/bin && ./clearcache && nohup ./startWeblogicAdmin >> admin.log' &
add a comment |Â
up vote
0
down vote
Having no idea of gcp linux, I suppose, the second example doesn't work because "&" is used by the shell to run commands in background. But ssh doesn't start any shell when you specify a command, it just runs the command, then exits.
So, if my assumption is right, you need to login to the remote system and execute commands using expect-like chat-language or try sending the whole command to background on your local system. Something like that:
nohup gcloud compute ssh -zone Zone-Name vm2 -- 'cd /app/bin && ./clearcache && nohup ./startWeblogicAdmin >> admin.log' &
add a comment |Â
up vote
0
down vote
up vote
0
down vote
Having no idea of gcp linux, I suppose, the second example doesn't work because "&" is used by the shell to run commands in background. But ssh doesn't start any shell when you specify a command, it just runs the command, then exits.
So, if my assumption is right, you need to login to the remote system and execute commands using expect-like chat-language or try sending the whole command to background on your local system. Something like that:
nohup gcloud compute ssh -zone Zone-Name vm2 -- 'cd /app/bin && ./clearcache && nohup ./startWeblogicAdmin >> admin.log' &
Having no idea of gcp linux, I suppose, the second example doesn't work because "&" is used by the shell to run commands in background. But ssh doesn't start any shell when you specify a command, it just runs the command, then exits.
So, if my assumption is right, you need to login to the remote system and execute commands using expect-like chat-language or try sending the whole command to background on your local system. Something like that:
nohup gcloud compute ssh -zone Zone-Name vm2 -- 'cd /app/bin && ./clearcache && nohup ./startWeblogicAdmin >> admin.log' &
answered Aug 8 at 9:26
Mikhail Zakharov
1246
1246
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f461210%2fhow-to-run-process-in-background-using-gcloud-ssh%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password