Given the situation you mention before, i'd go save that data (servername, url, local_script_location, remote_script_location,user, (password?)) either in a csv file or
as arrays directly inside the script.
So you then could let the user select among the "${servername[@]}" array, count out its index number, and read the other arrays index number into variables, so you can then re-use the actual 'work-code' one time for all the 'diffrent' servers.
Also, you could 'connect' the the ssh commands so you dont have to call it twice, thought that might be inconvienient.
However, would more imagine you want the txt-file removed, and leave the script there for reuse, so the above example would be un-usable?
Why you must run it as sudo (does that even work remote?) and invoke sh to execute an sh script which should be executeable anyway, is something i wonder about.
And this is what i would consider the cause for the either empty or non existing file...
I must admit I'm a bit confused by this bit:-
I would drop the square brackets, unless you are planning to use an expression, but I think you have a structural error in the code. From what I understand, the actions taken when a case statement finds a match (in this case $opt is 1) is ended by a ;;, so I don't see how the rest of that block of code runs, indeed I would expect a syntax error of some sort, unless perhaps the error is missed because the break steps you out somehow.
I get this:-
May I suggest that you change it like this:-
I now get the following output:-
Obviously I didn't want to action the later commands, so they're just displays to show them. You will want some validity checking on the IP address too.. Mine is illegal in so many ways.
Hello to all,
I'd like to tabulate the content of the XML file below, I've been trying with AWK putting the Top node (<KIND>) as RS and so far I'm able to print the first and second field of each record, but I don't know how to continue with the following nodes that have more inner nodes.
The... (4 Replies)
Hi all. I have two nodes taken different places. They are connected together on a network. So, i have a service, it works on one of nodes and when the node is unavailable the service should will be launched on other node.
Solution: rhel cluster, keepalive, hearbeat...may be Carp
but what if... (2 Replies)
I am new to cluster commands. But I have tried utilizing: -pe, but I do not know my parallel computing environment. We are running SGE, is there a simpler command to request more nodes?
also: qsub -N auto -M name@email.com -m abe auto.sh
does not email me at all.
Help would be appreciated (0 Replies)
Hello All,
Anybody knows how can I run script on the AIX HACMP offline node, without logon a offline node?
I would like to run a script on the online node and at same time or after the online node on the offline node.
Any IDEA? :confused: (3 Replies)
hello Gurus,
My current set up is 3 to 1 Cluster (SUN Cluster 3.2) running oracle database. Task is to reboot the servers. My query is about the procedure to do the same.
My understanding is suspend the databases to avoid switchover. Then execute the command scshutdown to down the cluster... (4 Replies)
Dear all,
I am bit confused lately, I have a xmlfile here:
file: book.xml
<?xml version="1.0" encoding="ISO-8859-1"?>
<bookstore>
<book category="COOKING">
<title lang="en">Everyday Italian</title>
<author>Giada De Laurentiis</author>
<year>2005</year>
... (2 Replies)
Hi folks,
I'm a bit of a novice at this but here goes. I want to read in nodes from an XML file, and map the path to each.
eg the file is structured
<node><nodename>.</nodename>
<node><nodename>topnode</nodename>
<node><nodename>subnode1</nodename></node>
... (1 Reply)
Does anyone know something about this? I have no idea what it means and how to do it. but if anyone can give me and explanation and also point me to a website, i'd really appreciate it (5 Replies)
first off, i am new to unix so please bear with me. i was reading somewhere that if your i-nodes get critical that it can slow your network down. what are i-nodes and when do they become a critical number? this is what mine states:
/ (/dev/root ): 777058 blocks 569290 i-nodes... (4 Replies)