Quote:
Hi, I'm wondering if there's a way to send a command periodically to remote server through a script.
Right now I have this:
Code:
keepLooping=1
ssh user@domain
while (( keepLooping == 1 ))
do
echo a
sleep 3[/CODE]
donebut what this does is ssh to the server, and only when the connection is closed do the following commands run. What I'm trying to achieve is to automate me SSHing to the server and entering a command every xx seconds.
Any suggestions? Thanks!
|
I'm not quite sure what you're trying to do but your while loop is in the wrong place.
Code:
keepLooping=1
while (( keepLooping == 1 ))
do
ssh user@domain
echo a
if [ ?? ] ; then
do something
else
set keeplooping to 1
fi
sleep 3[/CODE]