ssh on ksh
Code:
#!/bin/ksh any thoughts? |
Hi,
there are various ways to do this. The simplest is probably to put the shell script on SERVERNAME and then run it over ssh. For example: Code:
scp myscript.sh SERVERNAME: Code:
#!/bin/sh Code:
ssh SERVERNAME 'ps -ed | grep smon' > output.txt Evo2. |
more questions please:
1. Once I get the output generated on the remote server, how can I list to make sure the file is existed? $ ls 2. then if the file existed, there is a string I am interested so I am thinking of grep..... basically, I want to be on the source server, look for the file if it existed on the remote server and search for the string....... thanks, |
great, thanks
I have another question, below is what I have in my code: Code:
when I run my script, I got the error: grep: unknown devices method |
Hi,
hmm, I don't know about the error message, but I guess there is something wrong in your logic. Perhaps what you actually want is something like Code:
if grep --silent MYDB $log/output.tst ; then Evo2. |
ssh [-l login_name] [ hostname | user@hostname] [ com-mand]
Before doing this there are some settings needs to be done, else you can only use interactive mode for entring password. If you need to incorporate the ssh in batch mode you have to have the keys create. See the help for ssh for more details. |
All times are GMT -5. The time now is 08:07 PM. |