help with remote execution of a script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting help with remote execution of a script
# 1  
Old 04-06-2010
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 '


'
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. 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

2. Shell Programming and Scripting

Exiting the Remote server after script execution

Hi All , I'm running a script abc.sh in server "host1" shown as below : #! /bin/bash sh stop.sh ssh user@$host2 "/home/user/prod_work/xyz.sh; sh start.sh The problem I am facing is , the control is not passed to host1 after executing the script "xyz.sh" in host2 . ... (12 Replies)
Discussion started by: Pradeep_1990
12 Replies

3. Shell Programming and Scripting

Pause processes in remote host and resume execution in another remote host

Hi, Given addresses of 2 remote machines, using a shell script is it possible to get the state of running processes in "src" stop all the processes in "src" exit out of "src" ssh into "dest" resume the state of executing processes captured in step 1 in "dest" Assumption: "src" is... (3 Replies)
Discussion started by: Saeya Darsan
3 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

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

6. 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

7. 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

8. 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

9. AIX

remote execution

good morning I would like copy and execute a shell script on a remote server telnet is not autorize, so i use ssh: scp to copy and ssh to execute But with the scp, the permissions are not saved and the file 's permission on the remote server is r--r--r-- , so i can't execute it Can you help... (2 Replies)
Discussion started by: pascalbout
2 Replies

10. Shell Programming and Scripting

remote execution

Hi everybody, sorry if the question will be too trivial for some of you, but I'm not a unix shell programmer expert. I need to write a script that allows me to rlogin to another machine, check the load (cpu and mem usage) of the new machine, start a process (that will run in the background) and... (5 Replies)
Discussion started by: ragmelo
5 Replies
Login or Register to Ask a Question
rexec(3)						     Library Functions Manual							  rexec(3)

NAME
rexec, rexec_r - Allow command execution on a remote host LIBRARY
Standard C Library (libc.a) SYNOPSIS
#include <netdb.h> #include <unistd.h> int rexec( char **host, int port, char *user, char *passwd, char *command, int *err_file_desc); The following function is supported in order to maintain backward compatibility with previous versions of the operating system. int rexec_r( char **host, int port, char *user, char *passwd, char *command, int *err_file_desc, struct hos- tent_data *host_data); PARAMETERS
Contains the name of a remote host that is listed in the /etc/hosts file or /etc/resolv.conf file. If the name of the host is not found in either file, the rexec() fails. Specifies the well-known Internet port to use for the connection. A pointer to the structure that con- tains the necessary port can be obtained by issuing the following library call: getservbyname("exec", "tcp") Points to a user ID that is valid on the host. Points to the password of the specified user ID on the host. Points to the name of the command to be executed at the remote host. Specifies the file to which standard error from the remote command is sent. If the err_file_desc parameter is 0 (zero), the standard error of the remote command is the same as standard output. No provision is made for sending arbitrary signals to the remote process. In this case, however, it may be possible to send out-of-band data to the remote com- mand. If the err_file_desc parameter is nonzero, an auxiliary channel to a control process is set up, and a descriptor for it is placed in the err_file_desc parameter. The control process provides diagnostic output from the remote command on this channel and also accepts bytes as signal numbers to be forwarded to the process group of the command. This diagnostic information does not include remote authorization failure, since this connection is set up after authorization has been verified. Per-thread data for reentrant version. DESCRIPTION
The rexec() (remote execution) function allows the calling process to execute commands on a remote host. If the rexec() connection succeeds, a socket in the Internet domain of type SOCK_STREAM is returned to the calling process and is given to the remote command as standard input and standard output. The user and passwd parameters specify a valid user ID and the associated password for that user on the remote host. If the user and passwd parameters are not supplied, the rexec() function takes the following actions until finding a user ID and password to send to the remote host: It searches the current environment for the user ID and password on the remote host. It searches the user's home directory for a file called $HOME/.netrc that contains a user ID and password. It prompts the user for a user ID and password. Note that action 3 does not apply when using rexec_r(). NOTES
The rexec_r() function is the reentrant version of rexec(). It is supported in order to maintain backward compatibility with previous ver- sions of the operating system. The netdb.h header file defines the hostent_data structures. RETURN VALUES
Upon successful completion, the system returns a socket descriptor to the remote command. Otherwise, a value of -1 is returned, indicating that the specified hostname does not exist. FILES
Contains hostnames and their addresses for hosts in a network. This file is used to resolve a hostname into an Internet address. Contains the name server and domain name. Contains automatic login information. RELATED INFORMATION
Functions: getservbyname(3), rcmd(3), rresvport(3), ruserok(3). Commands: rexecd(8). delim off rexec(3)