The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 03-17-2008
sayeo sayeo is offline
Registered User
  
 

Join Date: Nov 2007
Posts: 18
script to send command periodically to remote server

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
done

but 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!