Hi,

I am trying to ssh to a server1 and perform a command to list all log files, but its throwing an error of:bash command {} not found in Linux, any ideas?.

Thanks,

PHP Code:
#!/bin/bash

 

   
for i in `cat /etc/hosts | grep server1 | awk '{ print $2 }'` ;

           do

              
#Find logs

              
ssh $i `find /opt/logs -name "*.log" -mtime +1 -exec ls -lrt` {} \;


                 
ssh $i 'echo `hostname` - `uptime`';

            
done