Hello all,
I am doing some measurement tests on my network and I am writing a script to scp a file between two computers.
What I need to do is ping the receiving-computer while the SCP is running. Find below the portion of code which I have written so far.
The problem with this code is that multiple instances of ping will initiate every time the loop is checked. Any ideas on how I can avoid that? (that is have only one instance of ping running until the scp transfer is complete!)
Thanking you all for your time and help,
atwinix
I am doing some measurement tests on my network and I am writing a script to scp a file between two computers.
What I need to do is ping the receiving-computer while the SCP is running. Find below the portion of code which I have written so far.
Code:
while ($scppresent == 1)
if (`ps -ax | grep scp | wc -l | cut -c 8-12` > 1) then
ping -i 0.02 -s 504 $scpClient
else
killall ping
set scppresent = 0
endif
end
The problem with this code is that multiple instances of ping will initiate every time the loop is checked. Any ideas on how I can avoid that? (that is have only one instance of ping running until the scp transfer is complete!)
Thanking you all for your time and help,
atwinix