script.ksh:
My assumption is, this will run "script.sh" to five server (server1A, server2B, etc).
But when i execute this script, it works fine until it finishes running in server1A, server1B, server1C, server1D and server1E. I was hoping after running in server1E the script will stop. But it doesnt. After the fifth "run" (in server1E), the script continues to execute, but this time it runs in (probably)some_host, which is invalid.
How can I exit the whole script after the last ssh (SERVER1E)?
And also, this is not important but would be nice to know, how can I execute a command, only on the last "iteration". I mean right before the script ends, im not sure how to do it since it restarts the whole script entirely.
Hi, I'm trying to run a user defined shell script with options and arguments via ssh but getting error as ksh: Script.sh: not found.
Here is what i'm running:
ssh -t username@server 'cd /path/to/script; script.sh -t start
here '-t' with script.sh, is an user defined option and 'start' is also... (3 Replies)
Hi All
I have created a script which is running properly "Script".
I want that script to run when I login into another server.
in the code below:
when ssh is executed it asks for password ..After entering password the user is logged in but the script does not run.... whereas when I exit... (1 Reply)
Hello,
I know for SSH'ing and running a local script is...
ssh -t user@servername < /path/to/localscript.sh
and with SSH'ing and SUDO'ing is...
ssh -t user@servername "sudo -u username ls -l /home/username"
My inquiry is how can I combine both, by SSH'ing and SUDO'ing but running... (4 Replies)
Hi All,
I have prepared a small script to monitor few applications running on diff unix boxes(frontend/backed node1/node2 etc).
ssh does not work for node2 when script executed from crontab..:wall: it work fine when i run it manually.
Regards,
Pavan (4 Replies)
Hello All,
I am trying to run some simulations through SSH from my mac on our university SOLARIS system. My problem is that whenever I want to execute a command I get an error which says "Invalid argument".
Maybe I should explain more what I want to do and what I did.
Firstly I installed a... (10 Replies)
Hello there.
I'm fairly new to Linux, but I am connecting via SSH and PuTTY to a remote server, and I am running a fairly heavy MySQL script in a PHP page.
Our connection here is dodgy to say the least and I get continuous disconnections.
My question is, when I get disconnected, does my... (4 Replies)
I'm working on a script (mostly for practice) to simplify a task I have to do every now and then. I have a cluster with 6 servers on it, each server has a directory with a set of files called *.pid and *.mpid. Each file contains the pid of a process that may or may not be running on that server.... (3 Replies)
Hi all,
I have a situation where I have a shell script that I need to run remotely on multiple *nix machines via SSH. Unfortunately, some of the commands in it require root access. I know that best practices for ssh entail configuring it so that the root account cannot log in, you need to... (4 Replies)
I ran an ssh command to run a script on a remote server
ssh -l <user> <servername> /path/to/script/scriptname
This works fine - and the script is executed correctly.
However - I put this command into a script, that I want to run from cron every hour, to execute the file on the remote... (31 Replies)
Writing a simple test script that looks for ssh, kills if its running and verifies if its still running. If it isn't, move on. My issue, its cause I don't know how, is to verify if ssh is running still. Also, is there a way have this do this on a remote server? I already have the ssh keys... (7 Replies)