Exiting the Remote server after script execution


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Exiting the Remote server after script execution
# 8  
Old 11-05-2014
Is there any reason why you don't want to show the content of /home/user/prod_work/xyz.sh as ygemici asked in post # 5?
# 9  
Old 11-05-2014
Yes . Sorry... I'm not in a position to show the script for security reasons but it is a simple script only and it is successfully executed nevertheless .

Thanks,
Pradeep
# 10  
Old 11-05-2014
Quote:
Originally Posted by Pradeep_1990
Yes . Sorry... I'm not in a position to show the script for security reasons but it is a simple script only and it is successfully executed nevertheless .

Thanks,
Pradeep
That's fine, I was wondering because that would had helped. No worries.
It appears that the content of the script is at fault.

---------- Post updated at 10:07 PM ---------- Previous update was at 09:52 PM ----------

Forgive me if this question sounds very simple.
Have you tried with another script, perhaps with just a ls or echoing something?
# 11  
Old 11-05-2014
Hi Aia ,

Thanks for the replies . I have got it working by directing the script to /dev/null (solution got from unix.com forum ).

Code:
ssh user@$host2 "/home/user/prod_work/xyz.sh > /dev/null"

But , not sure about the logic though .

Thanks,
Pradeep
# 12  
Old 11-13-2014
It might be better to redirect /home/user/prod_work/xyz.sh to /dev/null, to fix it on the remote side, instead of the local side. Less round-trip, and saves you one stream if you ever need it later.
This User Gave Thanks to Corona688 For This Post:
# 13  
Old 11-14-2014
Thanks . Will try the same .

Regards,
Pradeep
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Script connect to remote server, not find files and exit only from remote server, but not from scrip

I have a script, which connecting to remote server and first checks, if the files are there by timestamp. If not I want the script exit without error. Below is a code TARFILE=${NAME}.tar TARGZFILE=${NAME}.tar.gz ssh ${DESTSERVNAME} 'cd /export/home/iciprod/download/let/monthly;... (3 Replies)
Discussion started by: digioleg54
3 Replies

2. Shell Programming and Scripting

Remote script over ssh execution issues.

If I execute below code I am able to get string from column8 and column10 about a process. serverA1$> ps -ef | grep rotate | grep 'config' | awk '{print $8" "$10}' /<Oracle_home>/ohs/bin/odl_rotatelogs -h:/<app_Home>/config/OHS/ohs1/component_events.xml_ohs1... (12 Replies)
Discussion started by: kchinnam
12 Replies

3. Shell Programming and Scripting

How to Append the output of a script running in remote server to a file in local server?

Hi guys, So i am in server1 and i have to login to server 2, 3,4 and run some script there(logging script) and output its result. What i am doing is running the script in server2 and outputting it to a file in server 2 and then Scp'ing the file to server1. Similarly i am doing this for other... (5 Replies)
Discussion started by: srkmish
5 Replies

4. Solaris

Remote execution of a local script on multiple servers

So I have a scriptlet called solaris_command: for i in \ server1 server2 server3 do echo $i ssh $i $1 echo "" done I then use that as a command in multiple scripts to allow for data gathering for all virtual hosts in the environment thusly: solaris_command "cat... (3 Replies)
Discussion started by: os2mac
3 Replies

5. Shell Programming and Scripting

ssh - running remote command not exiting

Hi, i have a shellscript, where in i need to connect to different server start these three jobs and exit from the server and start the same three jobs on local server. ssh user@remotehost 'bash -s' << EOF ${GETT_HOME}/bin/start1 & sleep 10 ${GETT_HOME}/bin/start2 & sleep 10... (1 Reply)
Discussion started by: swapnabhargav
1 Replies

6. Shell Programming and Scripting

output from remote server during execution of a script

How to see the output from remote server during execution of a script ? I am executing a script (ls) from machine 1 but the o/p should be displayed in machine 2. Can I achieve this ? Example:- Machine 1:- # ls Machine 2:- (console) file1 file2 file 3 dir1 dir2 (0 Replies)
Discussion started by: frintocf
0 Replies

7. Programming

Perl script remote execution as another user

Hi gurus, I have a requirement where I need to remotely run a perl script as another user. Running the script locally as the required user is fine, however I need to su with the script due to filesystem permission issues. I do not want to update permissions on the remote server due to security... (5 Replies)
Discussion started by: melias
5 Replies

8. Shell Programming and Scripting

help with remote execution of a script

does anyone know how can i execute a script which i locally run as " . /etc/local/host/src.srvr -D ." need to execute above command in rexec command. if i put the command as it is it does not run. Sorry but i am naive in scripting. Thanks rexec sgplqim -l vau -n ' ' (0 Replies)
Discussion started by: NK4U
0 Replies

9. Shell Programming and Scripting

ssh can't back from remote host during script execution

Hi all I wrote a script to execute a script on several remote hosts, but somehow during the execution of the local script, ssh can't come back from the remote host, so that causes my local script hanging... I use the below command to do the job in the local script, any idea? ssh... (12 Replies)
Discussion started by: bzylg
12 Replies

10. Shell Programming and Scripting

problem with remote execution of script using telnet

Hi all, i am trying to remotely execute a script from a different server. this is the code that i use : #!bin/sh pwd (sleep 1 echo "username" sleep 2 echo "pwd" sleep 2 echo "cd /path/to/file" if then echo "script1.sh" echo "mailx -s "Task Executed"... (1 Reply)
Discussion started by: sais
1 Replies
Login or Register to Ask a Question