Im trying to measure bandwidth, packet loss, latency and jitter between two computers on a wireless 802.11s mesh connection.
Im trying to make a (my first) bash script that can do the following:
- SSH to another computer and start logging data from services (
- Start the same processes on my own computer and start logging data.
- Once the
iperftransmission on my own computer is finished, it should SSH into the remote computer and kill the the services.
The idea is for this these three steps run in a for-loop, that increases the package size transmitted by iperf for each iteration and logs the resulting data.
I know how to start a process on the remote pc by
ssh host@adress process.
I am however clueless on how to start multiple processes through SSH and logout, since the processes are terminated once I logout. I have looked at the
nohup commands, but don't know how to use them in a script.
Thanks in advance!
Thanks for all the help so far.
I got nohup to work now, it was pretty simple as people pointed out.
So now I got:
ssh host@adress nohup ./script.sh > /dev/null 2>&1 & in the script on my main pc.
This starts a script on the remote pc just fine, and then logout of SSH. The next problem is how to execute the script on the remote pc as sudo, since this is needed by tcpdump.
ssh host@adress **sudo** nohup ./script.sh > /dev/null 2>&1 & doesnt work.
If anybody is stuck with the same problem, I found a guide how to solve this: