SSH Loop command each minute


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers SSH Loop command each minute
# 1  
Old 07-23-2014
SSH Loop command each minute

Hello all Smilie

I want to know how can i do to loop a command each minute for example ?
I'm in SSH under Putty Smilie

Thanks you for your help Smilie
# 2  
Old 07-23-2014
Quote:
Originally Posted by stevefigueras
I want to know how can i do to loop a command each minute for example ?
I'm in SSH under Putty Smilie
There are two possible ways: you can write a script which does the looping itself, put that on the target machine and call this via ssh. The other way is to write a looping script on the local machine, which initiates something every minute on the target machine.

You will have to describe your requirements more specifically to get less general answers.

I hope this helps.

bakunin
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

While loop is causing ssh command to exit from script after first iteration.

I am trying to check multiple server's "uptime" in a loop over "ssh". When I execute multiple ssh commands with hard coded servernames script is executing fine. But when I pass server names using while loop, script is exiting after checking first server's status, why? # serverList... (8 Replies)
Discussion started by: kchinnam
8 Replies

2. AIX

Need help on for loop inside ssh

Hi, I am having a file like, #cat file Jun 19 13:08 Jun 19 13:08 Jun 19 13:08 Jun 19 13:14 when I run the below comamnd locally it will work fine, IFS=$'\n'; for i in $(cat file) ;do echo "HI $i" ; done And the output is, HI Jun 19 13:08 HI Jun 19 13:08 HI Jun 19 13:08 HI... (1 Reply)
Discussion started by: sumanthupar
1 Replies

3. Shell Programming and Scripting

While loop breaking when using "ssh" command inside

Hi , I am trying to read a list of hosts from a config file and trying to get file list from that host. For this I have used one while loop. cat "$ARCHIVE_CFG_FILE" | sed '/^$/d' | sed '/^#/d' | while read ARCHIVE_CFG do SOURCE_SERVER_NAME=`echo "$ARCHIVE_CFG" | awk -F '|' '{ print... (2 Replies)
Discussion started by: Anupam_Halder
2 Replies

4. Shell Programming and Scripting

[solved] Process ssh command in while loop

I have a script that reads a file containing a list of server names. It's suppose to loop through the list of names and execute a command on the remote server using ssh. It processes the ssh command for the first server in the list and then exits. Here's the code: #!/bin/bash ... (2 Replies)
Discussion started by: westmoreland
2 Replies

5. Shell Programming and Scripting

Take minute per minute from a log awk

Hi, I've been trying to develop a script that performs the parsing of a log every 1 minute and then generating some statistics. I'm fairly new to programming and this is why I come to ask if I can lend a hand. this is my log: xxxx 16/04/2012 17:00:52 - xxxx714 - E234 - Time= 119 ms.... (8 Replies)
Discussion started by: jockx
8 Replies

6. Shell Programming and Scripting

while loop stops after first iteration - remote ssh exit command problem?

I have written the following script to update some Debian boxes. #!/bin/bash mxg_hosts_file="/etc/mxg/ssh-hosts" while read line ; do mxg_host="$(echo ${line} | awk -F":" '{print $1}')" mxg_port="$(echo ${line} | awk -F":" '{print $2}')" echo "Connecting and Upgrading... (3 Replies)
Discussion started by: jelloir
3 Replies

7. UNIX for Dummies Questions & Answers

ssh and for loop

Hi all, I am facing an issue while trying to access a for loop variable inside ssh. Can anyone please help me with what this issue is, the following is the code that I have -> IMPL_LOG_FOLDERS=(transaction_logs invalid_transaction_logs) sshg3 ftp_id@boxname << EOS for log_folder in... (5 Replies)
Discussion started by: anindyabecs
5 Replies

8. Shell Programming and Scripting

ssh inside a for loop

Hi, The requirement is to ssh to unix servers and oracle databases, to perform some monitoring activity. I'm using shell script to perfom this. I pass the server details and database to a variable ... SERVERS="SERVER1 SERVER2 SERVER3" DATABASE="DB1 DB2 DB3" for i in $SERVERS do ssh... (2 Replies)
Discussion started by: senthil3d
2 Replies

9. Shell Programming and Scripting

using ssh with a for loop

How do you do an ssh on a for statement. I have done ssh on individula lines of code before with no problems. #!/usr/bin/ksh cat server_list.txt | while read line do ssh $line "for i in `lslpp -l |grep tsm` do lslpp -Lc $i |grep -v State |tr ':' ',' |awk -F, '{print $2, "," ,... (4 Replies)
Discussion started by: din
4 Replies

10. Shell Programming and Scripting

Pb in while loop with ssh command

Hi I use the following command to check if my_base is active or not : active_db=`${LOCAL_BIN}/ssh -l ${my_user} ${my_service} "ps -ef | grep ora_smon | grep ${my_base} | sed -e \"s/ */ /g\" | cut -d'?' -f2 | cut -d' ' -f3 | cut -d'_' -f3"` When I use a file listing databases to check them... (1 Reply)
Discussion started by: madmat
1 Replies
Login or Register to Ask a Question