thanks guys, I ended up going a different route. Instead of trying to initiate an ssh or telnet session in the script I just did an rsh. This ultimately gave me what I was looking for, since the box I was testing was oddly rebooting into single user mode, so if my rsh (telnet or ssh) failed I...
# more mylog
kill: 16760: no such process
I'm now thinking that the script is returning a failed run code, since the kill $! is failing to find a process. Is this more a problem with the writing of the script as opposed to running it out of cron?
I tried using the first two suggestions:
specifying full ssh path
adding su - root -c /path/to/myscript to cron
Script still fails.
I'll have to install nmap to try the nmap option, since I dont have it by default w/ solaris10.
When I run the below script from the cmd line it works as expected. The script will accurately detect whether an ssh connection is available. But, when I put this same script in cron it fails every time, even when an ssh connection is available. Any ideas? Or possibly a better method to...
Edited code:
#!/bin/ksh
while true
do
echo "
1) View ALL Failed Save Sets
2) Create Tickets for SERVER1 Failed Save Sets
q) Quit"
echo ""
read input
case $input in
1) clear
echo ""
echo "Listing of All Failed Save Sets:"
echo ""
awk '{print $0}' data.dat;;
2) clear...
I had removed the calls of ./script as well as add a break, but it did not work, so I just went back to my original code. I will try your suggestions again, post the edited code and tell you the results. thanks.
Well...I tried the suggestions you all noted above, but I am still unable to exit from the script back to a prompt. I also had a coworker look at it and he too was not able to get it to exit.
I will post my script again on the hopes of generating some new ideas. Thanks.
#!/bin/ksh
while...
This is a follow-up to my original post. The awk PHV worked well, and it now looks like this:
awk -F":" '
$4!=s{if(n>1)print " server:"s": All";n=0}
{print;s=$4;++n}
END{if(n>1)print "'date' server:"s": All"}
' tmp.server > tmp2.server
My question is, how can I modify the...
I removed the lines of the script calling itself and it works just the same - you were right they were unnecessary entries. However, I still cannot quit from the menu. I will look into the break command unless you guys have another suggestion.
Below is an example of a case script I'm using. The script works as expected, except for the q (quit/exit) option; it won't exit. Actually the script does exit properly if I choose q before choosing any other option. Unlike if I choose 2, then try and q, it wont work. I believe it has...
Sure. The lines of my input.file are currently arranged/sorted by server name. The server name is specified in the second field ($2), this is with the fields separated by the " : ". As in the example:
$1 $2 $3
homer: server1:/var/legato/rman/bin/ebuarch.PRTLDEV
homer...
First off, this site is such an amazing resource. Thanks to you all.
Suppose I have an input.file that looks like:
homer: server1:/var/legato/rman/bin/ebuarch.PRTLDEV
homer: server1:/var/legato/rman/bin/ebuarch.PRTLPROD
homer: server1:/var/legato/rman/bin/ebuarch.PRTLQA
homer...
My case is within a while-do-done. If this is what you were getting at, can you please explain further how this would work? thanks.
while true
do
read input
case $input in
1) option1
2) option2
3) clear
grep marge data2.email > data3.marge
echo ""
echo "Listing of MARGE Failed...
Below is a portion of a (ksh) case script. The way the menu works now is, via the select statement I can only choose one of the numbered options at a time. Is there a way to choose multiple options?
For example, if I run the script and choose option 3, I will be presented with a list that...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.