How to query for Ruby scripts currently running on Unix? -


i have few ruby scripts: a.rb, b.rb , c.rb. these scripts called corresponding wrapper shell scripts: a.sh, b.sh , c.sh.

all these scripts in distributed environment:

`a.sh` , `a.rb` on servera `b.sh` , `b.rb` on serverb `c.sh` , `c.rb` on serverc 

i need write script call.rb , wrapper call.sh script, should check scripts running on distributed environment.

i have logic determine different hosts have , how communicate these different hosts.

when ruby script running, command:

ps aux  

shows:

ruby a.rb 

i have no ideas on how query different scripts running. 1 thing note there might other ruby scripts running in system too, need check a.rb, b.rb, or c.rb.

you can execute commands via ssh this:

ssh user@host "ps -ef | grep '(ruby|[^.]+\.rb)'" 

grepping output of ps script names work:

ps -ef | grep '(a.rb|b.rb|c.rb)' 

edit: if don't want grep show in process list, filter this:

ps -ef | grep '(a.rb|b.rb|c.rb)' | grep -v grep 

Comments

Popular posts from this blog

Change php variable from jquery value using ajax (same page) -

Pull out data related to my apps from Android Play Store and iOS App Store -

How can I fetch data from a web server in an android application? -