bash - Getting the pid of a job launched in the background remotely -


I am trying to launch a job on a remote machine in the background and am getting its PID So that I may kill him later. What have I come up to now:

  #! / Bin / bash ip = xxx.xxx.xxx.xx REMOTE_EXEC = "ssh $ ip -l root" # The following does not work, I am trying to get PID of remote job PID = '$ REMOTE_EXEC' vmstat 1 1000 & gt; Vmstat.log & amp; ; Now $! '' #Also Apache Benchmark AB-N10 http: // $ $ IP / $ REMOTE_EXEC "Kill $ PID"  

Unfortunately this does not work. I'm getting a

  bash: syntax error with unexpected token `; ' 

But I do not know what the correct syntax will be.

You got the error, because you ';' Needless to try, 'vmstat 1 1000> vmstat.log & amp; Do allo !! '

But I'm not sure this will work, because after logging out, see the process SUPUP will get NOUP (1).


Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -