Jee Seok Yoon
Jee Seok Yoon

Reputation: 4816

Linux shell multitasking?

I have a cloud instance that I would like to run tests on. Its OS is Centos 6.3.

How can I run a jar file while using monitors like tcpdump/vmstat/top?

Upvotes: 0

Views: 108

Answers (1)

amadain
amadain

Reputation: 2836

Run in the background. Here is a stop and start for tcpdump that I used while running other processes:

function tcpdumpStart()
{
     echo "Turning on tcpdump to snoop the tunnel"
     sudo /usr/sbin/tcpdump -i tun0 -s0 -w /tmp/decoderTunnel.pcap &
     echo "tcpdump started" 
}

function tcpdumpStop()
{
     echo "Killing tunnel snoop"
     sudo pkill tcpdump
     sudo chmod =rwx,g+s /tmp/decoderTunnel.pcap 
     echo "Moving tunnel pcap decoderTunnel.pcap to ${testResultDest}"
     sudo mv /tmp/decoderTunnel.pcap ${testResultDest}
}

Do similar for each process you wish to start up

A

Upvotes: 2

Related Questions