i want to execute shell script on remote server with in sftp session


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting i want to execute shell script on remote server with in sftp session
# 1  
Old 10-15-2012
i want to execute shell script on remote server with in sftp session

Hi,


I want to execute shell script with in sftp session for remote server.

like i have a shell script test.sh that is on local server.i want to execute that script on remote server

sftp user@192.168.56.10
sftp> test.sh ---execute for remote server not for local server.


sftp oracle@192.168.56.101 << EOF
cd /home/ibney
test.sh # i want to execute this shell script on remote server
get *.*
exit
EOF

---------- Post updated at 06:24 AM ---------- Previous update was at 04:58 AM ----------

Please help to me for this problem
# 2  
Old 10-15-2012
sftp ONLY moves files between servers. You can execute local (not remote ) procedures.

Can you not use ssh?

Code:
ssh remotenode  '/path/on/remote/node/test.sh'

# 3  
Old 10-15-2012
hi,

But i don't have ssh access how to i can run script on remote server.Please
help me for this issue.I have to execute script on remote server within sftp session.
# 4  
Old 10-15-2012
There is no secret hidden way to run scripts inside sftp that we're hiding from you.

It's really, genuinely not a shell.

You can't run scripts inside it.

Period.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

How to execute setDomainEnv.sh in wblogic via ssh on remote server in shell script?

How to execute setDomainEnv.sh in wblogic via ssh on remote server in shell script we execute setDomainEnv.sh manually as . ./setDomainEnv.sh from its location ie /opt/SP/users/domian/bin" My approach is not working. Please advise. #!/bin/bash set -x base="/opt/SP/users/d1/bin"... (5 Replies)
Discussion started by: abhaydas
5 Replies

2. Shell Programming and Scripting

Running a script on remote server kills my login session

Hi there, I'm trying to run a script remotely on a server in a particular directory named after hostname which already exists, my login session gets killed as soon as I run the below command. Not sure what is wrong, is there a better way to do it ? Note: I can also use nohup command to run... (14 Replies)
Discussion started by: mbak
14 Replies

3. Shell Programming and Scripting

How to execute commands on remote server using expect script?

I need to copy python script file to around 100 servers using expect script. 1. Copy script to my user home first(/home/myhome) on each remote server 2. change permissions on copied file to 766. 3. sudo to appuser1 account on remote server. copy script file from my user home to /usr/bin/... (1 Reply)
Discussion started by: kchinnam
1 Replies

4. Solaris

Script to get files from remote server to local server through sftp without prompting for password

Hi, I am trying to automate the process of fetching files from remote server to local server through sftp. I have the username and password for the remote solaris server. But I need to give password manually everytime i run the script. Can anyone help me in automating the script such that it... (3 Replies)
Discussion started by: ssk250
3 Replies

5. Shell Programming and Scripting

Execute a local script against a remote server

I am unable to run the below script against a remote server due to syntax error (then unexpected), but i am able to run it locally. Am i executing it correctly or is there any other way to execute it. ssh username@servernname ksh -s < scriptname #!/bin/ksh function record { ((end =... (5 Replies)
Discussion started by: NarayanaPrakash
5 Replies

6. Shell Programming and Scripting

SFTP script to automate login in to remote server

Greetings, guys. I'm not much of a programmer forgive me for being a noob, because of someone leaving, I was put in an IT spot where I have to figure out a few things. Being new to Linux and programming has been a challenge. My boss has asked me to create an automated script to connect to a 3rd... (7 Replies)
Discussion started by: giovannym
7 Replies

7. Shell Programming and Scripting

Execute shell script within sftp session

Hi all , can any one tell me how to run a script within a sftp session. let me tell u in bit clear way : After I connected to sftp location , cd ing to some directory then I need to execute a one script. Please tell me if u have any idea on this . Looking forward to your reply guys... (1 Reply)
Discussion started by: sravan008
1 Replies

8. Shell Programming and Scripting

Use cURL in shell script and get most recent file from remote server using SFTP

I have been trying to implement the following shell script -- sftp to remote server get list of files in the directory sftp get the most recent listed file exit This script will be scheduled to be executed everyday using CRON or CONTROL-M and the need is to have absolutely no human... (7 Replies)
Discussion started by: toobrown1
7 Replies

9. Shell Programming and Scripting

Script to connect to a remote server and execute scripts

Hello All I need a script or set of commands which can establish a remote connection with another server and execute some scripts over there. Basically it has to establish the connection with the remote server as an user ,say 'testuser' and then execute the script 'testscript'. and return the... (5 Replies)
Discussion started by: sgbhat
5 Replies
Login or Register to Ask a Question